Skip to content

Commit c35fba5

Browse files
innerflyinnerfly
andauthored
Update dependencies (#195)
* update dependencies * update sspat/reserved-words in order to use last thecodingmachine/safe * update cebe/php-openapi * remove usage of Safe/sprintf, Safe/substr * fixing phpstan errors * fixing phpstan errors * fixing psalm errors * tests * tests * tests * downgrade cebe/php-openapi * Revert "downgrade cebe/php-openapi" This reverts commit ca5992a. * Add PHP 8.3 and 8.4 support and update dependencies * add security scheme * Revert "add security scheme" This reverts commit a1772c9. * update devizzent/cebe-php-openapi * csfix --------- Co-authored-by: innerfly <[email protected]>
1 parent cfd3909 commit c35fba5

File tree

53 files changed

+136
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+136
-74
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
php-version:
2020
- "8.1"
2121
- "8.2"
22+
- "8.3"
23+
- "8.4"
2224
dependencies:
2325
- "lowest"
2426
- "highest"
@@ -53,7 +55,7 @@ jobs:
5355
operating-system:
5456
- "ubuntu-latest"
5557
php-version:
56-
- "8.2"
58+
- "8.4"
5759
steps:
5860
- name: "Checkout"
5961
uses: "actions/checkout@v2"
@@ -81,7 +83,7 @@ jobs:
8183
operating-system:
8284
- "ubuntu-latest"
8385
php-version:
84-
- "8.2"
86+
- "8.4"
8587
steps:
8688
- name: "Checkout"
8789
uses: "actions/checkout@v2"
@@ -109,7 +111,7 @@ jobs:
109111
operating-system:
110112
- "ubuntu-latest"
111113
php-version:
112-
- "8.2"
114+
- "8.4"
113115
steps:
114116
- name: "Checkout"
115117
uses: "actions/checkout@v2"
@@ -137,7 +139,7 @@ jobs:
137139
operating-system:
138140
- "ubuntu-latest"
139141
php-version:
140-
- "8.2"
142+
- "8.4"
141143
steps:
142144
- name: "Checkout"
143145
uses: "actions/checkout@v2"
@@ -170,7 +172,7 @@ jobs:
170172
operating-system:
171173
- "ubuntu-latest"
172174
php-version:
173-
- "8.2"
175+
- "8.4"
174176
steps:
175177
- name: "Checkout"
176178
uses: "actions/checkout@v2"
@@ -201,7 +203,7 @@ jobs:
201203
operating-system:
202204
- "ubuntu-latest"
203205
php-version:
204-
- "8.2"
206+
- "8.4"
205207
steps:
206208
- name: "Checkout"
207209
uses: "actions/checkout@v2"

composer.json

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,13 @@
2121
"email": "[email protected]"
2222
}
2323
],
24-
"repositories": [
25-
{
26-
"type": "vcs",
27-
"url": "https://github.com/onmoon/php-openapi"
28-
}
29-
],
3024
"require": {
3125
"php": "^8.1",
3226
"ext-json": "*",
33-
"cebe/php-openapi": "1.6.99",
27+
"devizzent/cebe-php-openapi": "1.1.4",
3428
"league/openapi-psr7-validator": "^0.22.0",
3529
"lukasoppermann/http-status": "^4.0",
36-
"nikic/php-parser": "^4.19",
30+
"nikic/php-parser": "^v5.4",
3731
"nyholm/psr7": "^1.5",
3832
"phpdocumentor/reflection-docblock": "^5.3",
3933
"sspat/reserved-words": "^3.0",
@@ -47,23 +41,23 @@
4741
"symfony/psr-http-message-bridge": "^6.4|^7.0",
4842
"symfony/routing": "^6.4|^7.0",
4943
"symfony/yaml": "^6.4|^7.0",
50-
"thecodingmachine/safe": "^1.3|^2"
44+
"thecodingmachine/safe": "^3.1"
5145
},
5246
"require-dev": {
5347
"doctrine/coding-standard": "^12.0",
5448
"matthiasnoback/symfony-config-test": "^5.1",
5549
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
56-
"phpstan/phpstan": "^1.11",
57-
"phpstan/phpstan-phpunit": "^1.4",
58-
"phpstan/phpstan-strict-rules": "^1.6",
50+
"phpstan/phpstan": "^2.1",
51+
"phpstan/phpstan-phpunit": "^2.0",
52+
"phpstan/phpstan-strict-rules": "^2.0",
5953
"phpunit/phpunit": "^10.5",
60-
"roave/infection-static-analysis-plugin": "^1.35",
54+
"roave/infection-static-analysis-plugin": "^1.37",
6155
"squizlabs/php_codesniffer": "^3.10",
6256
"symfony/browser-kit": "^6.4|^7.0",
6357
"symfony/dom-crawler": "^6.4|^7.0",
6458
"symfony/framework-bundle": "^6.4|^7.0",
65-
"thecodingmachine/phpstan-safe-rule": "^1.2",
66-
"vimeo/psalm": "^5.24"
59+
"thecodingmachine/phpstan-safe-rule": "v1.4",
60+
"vimeo/psalm": "^6.10"
6761
},
6862
"minimum-stability": "stable",
6963
"prefer-stable": true,

src/CodeGenerator/ApiServerCodeGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use const DIRECTORY_SEPARATOR;
1313

14-
class ApiServerCodeGenerator
14+
final class ApiServerCodeGenerator
1515
{
1616
private GraphGenerator $graphGenerator;
1717
private NameGenerator $nameGenerator;

src/CodeGenerator/AttributeGenerator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use OnMoon\OpenApiServerBundle\CodeGenerator\Definitions\PropertyDefinition;
1111
use OnMoon\OpenApiServerBundle\Specification\Definitions\Property;
1212

13+
/** @psalm-suppress ClassMustBeFinal */
1314
class AttributeGenerator
1415
{
1516
public function setAllAttributes(GraphDefinition $graph): void

src/CodeGenerator/Definitions/ClassDefinition.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
namespace OnMoon\OpenApiServerBundle\CodeGenerator\Definitions;
66

7-
use function Safe\substr;
7+
use Override;
8+
89
use function strrpos;
10+
use function substr;
911

1012
class ClassDefinition implements ClassReference
1113
{
1214
private string $className;
1315
private string $namespace;
1416

17+
#[Override]
1518
final public function getClassName(): string
1619
{
1720
return $this->className;
@@ -24,6 +27,7 @@ final public function setClassName(string $className): self
2427
return $this;
2528
}
2629

30+
#[Override]
2731
final public function getNamespace(): string
2832
{
2933
return $this->namespace;
@@ -36,6 +40,7 @@ final public function setNamespace(string $namespace): self
3640
return $this;
3741
}
3842

43+
#[Override]
3944
final public function getFQCN(): string
4045
{
4146
return $this->namespace . '\\' . $this->className;

src/CodeGenerator/Definitions/ComponentDefinition.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace OnMoon\OpenApiServerBundle\CodeGenerator\Definitions;
66

7-
class ComponentDefinition
7+
final class ComponentDefinition
88
{
99
private DtoDefinition $dto;
1010

src/CodeGenerator/Definitions/ComponentReference.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,33 @@
44

55
namespace OnMoon\OpenApiServerBundle\CodeGenerator\Definitions;
66

7-
class ComponentReference implements DtoReference
7+
use Override;
8+
9+
final class ComponentReference implements DtoReference
810
{
911
public function __construct(private ComponentDefinition $referencedComponent)
1012
{
1113
}
1214

15+
#[Override]
1316
public function getClassName(): string
1417
{
1518
return $this->referencedComponent->getDto()->getClassName();
1619
}
1720

21+
#[Override]
1822
public function getNamespace(): string
1923
{
2024
return $this->referencedComponent->getDto()->getNamespace();
2125
}
2226

27+
#[Override]
2328
public function getFQCN(): string
2429
{
2530
return $this->referencedComponent->getDto()->getFQCN();
2631
}
2732

33+
#[Override]
2834
public function isEmpty(): bool
2935
{
3036
return $this->referencedComponent->getDto()->isEmpty();

src/CodeGenerator/Definitions/DtoDefinition.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
namespace OnMoon\OpenApiServerBundle\CodeGenerator\Definitions;
66

77
use OnMoon\OpenApiServerBundle\Interfaces\Dto;
8+
use Override;
89

910
use function count;
1011

11-
class DtoDefinition extends GeneratedClassDefinition implements DtoReference
12+
final class DtoDefinition extends GeneratedClassDefinition implements DtoReference
1213
{
1314
/** @var PropertyDefinition[] $properties; */
1415
private array $properties;
@@ -21,6 +22,7 @@ public function __construct(array $properties)
2122
$this->properties = $properties;
2223
}
2324

25+
#[Override]
2426
final public function isEmpty(): bool
2527
{
2628
return count($this->properties) === 0;

src/CodeGenerator/FileGenerator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use function array_push;
1616

17+
/** @psalm-suppress ClassMustBeFinal */
1718
class FileGenerator
1819
{
1920
private DtoCodeGenerator $dtoGenerator;

src/CodeGenerator/Filesystem/FilePutContentsFileWriter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace OnMoon\OpenApiServerBundle\CodeGenerator\Filesystem;
66

7+
use Override;
8+
79
use function is_dir;
810
use function Safe\file_put_contents;
911
use function Safe\mkdir;
@@ -19,6 +21,7 @@ public function __construct(int $dirPemissions)
1921
$this->dirPemissions = $dirPemissions;
2022
}
2123

24+
#[Override]
2225
public function write(string $path, string $filename, string $contents): void
2326
{
2427
if (! is_dir($path)) {

0 commit comments

Comments
 (0)