Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DerManoMann committed Dec 22, 2023
1 parent 84f23e3 commit 5d94b61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 252 deletions.
250 changes: 0 additions & 250 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ parameters:
count: 1
path: src/Adapters/Laravel/OpenApiVerifierMiddleware.php

-
message: "#^Function app not found\\.$#"
count: 1
path: src/Adapters/Laravel/OpenApiVerifierMiddleware.php

-
message: "#^PHPDoc tag @var for variable \\$verifier has invalid type Radebatz\\\\OpenApi\\\\Verifier\\\\VerifiesOpenApi\\.$#"
count: 1
Expand All @@ -30,21 +25,11 @@ parameters:
count: 1
path: src/Adapters/Slim/OpenApiVerifierMiddleware.php

-
message: "#^Call to method handle\\(\\) on an unknown class Psr\\\\Http\\\\Server\\\\RequestHandlerInterface\\.$#"
count: 1
path: src/Adapters/Slim/OpenApiVerifierMiddleware.php

-
message: "#^Call to method verifyOpenApi\\(\\) on an unknown class Radebatz\\\\OpenApi\\\\Verifier\\\\VerifiesOpenApi\\.$#"
count: 1
path: src/Adapters/Slim/OpenApiVerifierMiddleware.php

-
message: "#^Class Psr\\\\Http\\\\Server\\\\RequestHandlerInterface not found\\.$#"
count: 1
path: src/Adapters/Slim/OpenApiVerifierMiddleware.php

-
message: "#^PHPDoc tag @var for variable \\$verifier has invalid type Radebatz\\\\OpenApi\\\\Verifier\\\\VerifiesOpenApi\\.$#"
count: 1
Expand All @@ -59,238 +44,3 @@ parameters:
message: "#^Access to an undefined property object\\:\\:\\$anyOf\\.$#"
count: 1
path: src/OpenApiSpecificationLoader.php

-
message: "#^Access to an undefined property Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\LaravelAdapterTest\\:\\:\\$app\\.$#"
count: 2
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Access to an undefined property Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\LaravelAdapterTest\\:\\:\\$openapiSpecification\\.$#"
count: 3
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Access to offset 'config' on an unknown class Illuminate\\\\Foundation\\\\Application\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Call to an undefined method Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\LaravelAdapterTest\\:\\:get\\(\\)\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Call to an undefined method Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\LaravelAdapterTest\\:\\:markTestSkipped\\(\\)\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Call to an undefined static method Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\LaravelTestCase\\:\\:setUp\\(\\)\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Call to method make\\(\\) on an unknown class Illuminate\\\\Foundation\\\\Application\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Call to static method setFacadeApplication\\(\\) on an unknown class Illuminate\\\\Support\\\\Facades\\\\Facade\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Class Illuminate\\\\Contracts\\\\Console\\\\Kernel not found\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Class Illuminate\\\\Contracts\\\\Http\\\\Kernel not found\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Function OpenApi\\\\scan not found\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^If condition is always true\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^PHPDoc tag @var for variable \\$app contains unknown class Illuminate\\\\Foundation\\\\Application\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Parameter \\$app of method Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\LaravelAdapterTest\\:\\:registerOpenApiVerifier\\(\\) has invalid type Illuminate\\\\Foundation\\\\Application\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Ternary operator condition is always false\\.$#"
count: 1
path: tests/Adapters/LaravelAdapterTest.php

-
message: "#^Access to an undefined property Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\Slim3AdapterTest\\:\\:\\$app\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Access to an undefined property Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\Slim3AdapterTest\\:\\:\\$openapiSpecification\\.$#"
count: 3
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Call to method add\\(\\) on an unknown class Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Call to method get\\(\\) on an unknown class Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Call to method getContainer\\(\\) on an unknown class Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Call to method process\\(\\) on an unknown class Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Call to static method createFromEnvironment\\(\\) on an unknown class Slim\\\\Http\\\\Request\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Call to static method mock\\(\\) on an unknown class Slim\\\\Http\\\\Environment\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Function OpenApi\\\\scan not found\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^If condition is always true\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Instantiated class Slim\\\\App not found\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Instantiated class Slim\\\\Http\\\\Response not found\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^PHPDoc tag @var for variable \\$app contains unknown class Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Parameter \\$app of method Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\Slim3AdapterTest\\:\\:registerOpenApiVerifier\\(\\) has invalid type Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Ternary operator condition is always false\\.$#"
count: 1
path: tests/Adapters/Slim3AdapterTest.php

-
message: "#^Access to an undefined property Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\Slim4AdapterTest\\:\\:\\$app\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Access to an undefined property Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\Slim4AdapterTest\\:\\:\\$openapiSpecification\\.$#"
count: 3
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Call to method add\\(\\) on an unknown class Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Call to method build\\(\\) on an unknown class DI\\\\ContainerBuilder\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Call to method getContainer\\(\\) on an unknown class Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Call to static method create\\(\\) on an unknown class Slim\\\\Factory\\\\AppFactory\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Call to static method setContainer\\(\\) on an unknown class Slim\\\\Factory\\\\AppFactory\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Function OpenApi\\\\scan not found\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^If condition is always true\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Instantiated class DI\\\\ContainerBuilder not found\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^PHPDoc tag @var for variable \\$app contains unknown class Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Parameter \\$app of method Radebatz\\\\OpenApi\\\\Verifier\\\\Tests\\\\Adapters\\\\Slim4AdapterTest\\:\\:registerOpenApiVerifier\\(\\) has invalid type Slim\\\\App\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^Ternary operator condition is always false\\.$#"
count: 1
path: tests/Adapters/Slim4AdapterTest.php

-
message: "#^If condition is always true\\.$#"
count: 1
path: tests/VerifiesOpenApiTest.php
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parameters:
level: 5
paths:
- src
- tests
# - tests
parallel:
processTimeout: 300.0
excludePaths:
Expand Down
4 changes: 3 additions & 1 deletion src/Adapters/AbstractOpenApiResponseVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Radebatz\OpenApi\Verifier\Adapters;

use OpenApi\Generator;

trait AbstractOpenApiResponseVerifier
{
protected string $openapiSpecification;
Expand Down Expand Up @@ -35,7 +37,7 @@ protected function prepareOpenApiSpecificationLoader(string $srcDir, ?string $sp
if (!$specificationLoader) {
$appRoot = $appRoot ?: $this->getAppRoot();

$openApi = \OpenApi\scan($appRoot . '/' . $srcDir);
$openApi = Generator::scan($appRoot . '/' . $srcDir);
$this->openapiSpecification = json_decode($openApi->toJson());
}
}
Expand Down

0 comments on commit 5d94b61

Please sign in to comment.