Skip to content

Commit 303688c

Browse files
sspatPatrik Foldes
and
Patrik Foldes
authored
get rid of forks (#174)
* get rid of forks * Fix static analysis complaints * Fix mutation testing error * fix phpstan error Co-authored-by: Patrik Foldes <pf@csgo.com>
1 parent 0223f4f commit 303688c

File tree

4 files changed

+17
-27
lines changed

4 files changed

+17
-27
lines changed

README.md

-13
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,6 @@ All you have to do is to implement the API call handler interfaces and return th
2424

2525
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
2626

27-
The following workaround with a forked version of `cebe/php-openapi` will be used until a version of it
28-
compatible with php 8.1 will be released:
29-
30-
Add to your composer.json
31-
```
32-
"repositories": [
33-
{
34-
"type": "vcs",
35-
"url": "https://github.com/onmoon/php-openapi"
36-
}
37-
],
38-
```
39-
4027
Run
4128

4229
```

composer.json

+2-12
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"require": {
2525
"php": "^8.0",
2626
"ext-json": "*",
27-
"cebe/php-openapi": "dev-php-81-compat",
28-
"league/openapi-psr7-validator": "dev-use-forked-php-openapi",
27+
"cebe/php-openapi": "^1.7",
28+
"league/openapi-psr7-validator": "^0.18.0",
2929
"lukasoppermann/http-status": "^3.2",
3030
"nikic/php-parser": "^4.13",
3131
"nyholm/psr7": "^1.5",
@@ -60,16 +60,6 @@
6060
"thecodingmachine/phpstan-safe-rule": "^1.2",
6161
"vimeo/psalm": "^4.22"
6262
},
63-
"repositories": [
64-
{
65-
"type": "vcs",
66-
"url": "https://github.com/onmoon/php-openapi"
67-
},
68-
{
69-
"type": "vcs",
70-
"url": "https://github.com/onmoon/openapi-psr7-validator"
71-
}
72-
],
7363
"minimum-stability": "dev",
7464
"prefer-stable": true,
7565
"config": {

phpstan.neon

+12
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ parameters:
2929
message: '#Instanceof between cebe\\openapi\\spec\\MediaType and cebe\\openapi\\spec\\MediaType will always evaluate to true\.#'
3030
paths:
3131
- %currentWorkingDirectory%/src/Specification/SpecificationParser.php
32+
-
33+
message: '#SpecificationLoaderTest\.php:55\)\) of method#'
34+
paths:
35+
- %currentWorkingDirectory%/test/functional/Specification/SpecificationLoaderTest.php
36+
-
37+
message: '#TestApiServerCodeGeneratorFactory\.php:55\)\) of method#'
38+
paths:
39+
- %currentWorkingDirectory%/test/generation/TestApiServerCodeGeneratorFactory.php
40+
-
41+
message: '#OnMoon\\OpenApiServerBundle\\Router\\RouteLoader::__construct\(\) does not call parent constructor from Symfony\\Component\\Config\\Loader\\Loader\.#'
42+
paths:
43+
- %currentWorkingDirectory%/src/Router/RouteLoader.php
3244
includes:
3345
- vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
3446
- vendor/phpstan/phpstan-phpunit/extension.neon

src/Router/RouteLoader.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use OnMoon\OpenApiServerBundle\Controller\ApiController;
88
use OnMoon\OpenApiServerBundle\Specification\SpecificationLoader;
99
use OnMoon\OpenApiServerBundle\Types\ArgumentResolver;
10+
use Stringable;
1011
use Symfony\Component\Config\Loader\Loader;
1112
use Symfony\Component\Routing\Route;
1213
use Symfony\Component\Routing\RouteCollection;
@@ -25,8 +26,6 @@ public function __construct(SpecificationLoader $loader, ArgumentResolver $argum
2526
{
2627
$this->loader = $loader;
2728
$this->argumentResolver = $argumentResolver;
28-
29-
parent::__construct();
3029
}
3130

3231
public function load(mixed $resource, ?string $type = null): RouteCollection
@@ -37,10 +36,12 @@ public function load(mixed $resource, ?string $type = null): RouteCollection
3736
$routes = new RouteCollection();
3837

3938
foreach ($specification->getOperations() as $operationId => $operation) {
39+
/** @psalm-var array<(string|Stringable)> $requirements */
4040
$requirements = [];
4141

4242
$parameters = $operation->getRequestParameters();
4343
if (array_key_exists('path', $parameters)) {
44+
/** @psalm-var array<(string|Stringable)> $requirements */
4445
$requirements = $this->argumentResolver->resolveArgumentPatterns($parameters['path']);
4546
}
4647

0 commit comments

Comments
 (0)