From e25e03ad4616b0624427d1cd3addc4355a9704d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Felix=20=C5=A0ulc?= Date: Thu, 10 Feb 2022 13:47:59 +0100 Subject: [PATCH] QA: phpstan, tests, github actions --- .github/workflows/codesniffer.yml | 4 +--- .github/workflows/coverage.yml | 17 +++++++++++++ .github/workflows/phpstan.yml | 4 +--- .github/workflows/tests.yml | 15 ++++++++---- Makefile | 8 +++---- composer.json | 19 +++++++-------- phpstan.neon | 13 ++++++++-- ruleset.xml | 24 +++++++------------ src/Core/DI/Plugin/CoreSchemaPlugin.php | 2 ++ src/Core/Handler/ServiceCallback.php | 3 ++- src/Core/Mapping/RequestParameterMapping.php | 12 ++++------ src/Core/Utils/Helpers.php | 14 +++++++++++ .../Console/Command/RouteDumpCommand.phpt | 0 .../Core/Adjuster/FileResponseAdjuster.phpt | 0 .../Core/Annotation/Controller/Id.phpt | 0 .../Core/Annotation/Controller/Method.phpt | 0 .../Annotation/Controller/Negotiation.phpt | 0 .../Annotation/Controller/Negotiations.phpt | 0 .../Core/Annotation/Controller/Path.phpt | 0 .../Annotation/Controller/RequestBody.phpt | 0 .../Controller/RequestParameter.phpt | 0 .../Controller/RequestParameters.phpt | 0 .../Core/Annotation/Controller/Tag.phpt | 0 .../Core/DI/ApiExtension.phpt | 0 .../DI/Loader/DoctrineAnnotationLoader.phpt | 0 .../Loader/DoctrineMultiAnnotationLoader.phpt | 0 .../MixedAttributeAnnotationLoader.phpt | 0 .../Core/Decorator/DecoratorManager.phpt | 0 .../Core/Dispatcher/CoreDispatcher.phpt | 0 .../Core/Dispatcher/DecoratedDispatcher.phpt | 0 .../Core/Dispatcher/JsonDispatcher.phpt | 0 .../Core/ErrorHandler/PsrLogErrorHandler.phpt | 0 .../Core/ErrorHandler/SimpleErrorHandler.phpt | 0 .../Core/Exception/ExceptionExtra.phpt | 0 .../Core/Handler/ServiceHandler.phpt | 0 .../Core/Http/ApiRequest.phpt | 0 .../Mapping/Parameter/BooleanTypeMapper.phpt | 0 .../Mapping/Parameter/DateTimeTypeMapper.phpt | 0 .../Mapping/Parameter/FloatTypeMapper.phpt | 0 .../Mapping/Parameter/IntegerTypeMapper.phpt | 0 .../Mapping/Parameter/StringTypeMapper.phpt | 0 .../Core/Mapping/RequestEntityMapping.phpt | 0 .../Core/Mapping/RequestParameterMapping.phpt | 0 .../Mapping/Validator/SymfonyValidator.phpt | 0 .../Core/Router/SimpleRouter.phpt | 0 .../Core/Schema/Endpoint.phpt | 0 .../Core/Schema/SchemaBuilderTest.php | 0 .../Core/Schema/SchemaInspector.phpt | 0 .../Schema/Serialization/ArrayHydrator.phpt | 0 .../Serialization/ArraySerializator.phpt | 0 .../Validation/ControllerPathValidation.phpt | 0 .../Validation/ControllerValidation.phpt | 0 .../Schema/Validation/FullpathValidation.phpt | 0 .../Validation/GroupPathValidation.phpt | 0 .../Core/Schema/Validation/IdValidation.phpt | 0 .../Validation/NegotiationValidation.phpt | 0 .../Schema/Validation/PathValidation.phpt | 0 .../Validation/RequestBodyValidation.phpt | 0 .../RequestParameterValidation.phpt | 0 .../{cases => Cases}/Core/Utils/Helpers.phpt | 10 ++++++++ tests/{cases => Cases}/Core/Utils/Regex.phpt | 0 .../Transformer/DebugDataTransformerTest.php | 0 .../Middlewares/ApiMiddleware.phpt | 0 .../Negotiation/SuffixNegotiator.phpt | 0 .../Transformer/CsvTransformer.phpt | 0 .../Transformer/JsonTransformer.phpt | 0 .../OpenApi/DI/OpenApiPlugin.phpt | 0 .../OpenApi/Schema/ContactTest.php | 0 .../OpenApi/Schema/ExamplesTest.php | 0 .../Schema/ExternalDocumentationTest.php | 0 .../OpenApi/Schema/InfoTest.php | 0 .../OpenApi/Schema/LicenseTest.php | 0 .../OpenApi/Schema/MediaTypeTest.php | 0 .../OpenApi/Schema/OperationTest.php | 0 .../OpenApi/Schema/ParameterTest.php | 0 .../OpenApi/Schema/RequestBodyTest.php | 0 .../OpenApi/Schema/ResponseTest.php | 0 .../OpenApi/Schema/ResponsesTest.php | 0 .../OpenApi/Schema/ServerTest.php | 0 .../OpenApi/Schema/ServerVariableTest.php | 0 .../OpenApi/Schema/TagTest.php | 0 .../Schema/examples/api-with-examples.yaml | 0 .../Schema/examples/callback-example.yaml | 0 .../OpenApi/Schema/examples/link-example.yaml | 0 .../Schema/examples/petstore-expanded.yaml | 0 .../OpenApi/Schema/examples/petstore.yaml | 0 .../OpenApi/Schema/examples/uspto.yaml | 0 .../OpenApi/SchemaBuilderTest.php | 0 .../SchemaDefinition/CoreDefinitionTest.php | 0 .../Entity/EntityAdapterTest.php | 0 .../OpenApi/SchemaType/BaseSchemaTypeTest.php | 0 .../Presenter/ApiRouteTest.phpt | 0 .../Controllers/AbstractController.php | 0 .../AnnotationFoobarController.php | 0 .../Controllers/AnnotationMultiController.php | 0 .../Controllers/ApiV1Controller.php | 0 .../Controllers/AttributeFoobarController.php | 0 .../Controllers/AttributeMultiController.php | 0 .../Mixed/AnnotationAttributeController.php | 0 .../Mixed/AttributesOnlyController.php | 8 +++---- .../Mixed/PathAndRequestParamsController.php | 6 ++--- .../EarlyReturnResponseExceptionDecorator.php | 0 .../Decorator/RethrowErrorDecorator.php | 0 .../Decorator/ReturnRequestDecorator.php | 0 .../Decorator/ReturnResponseDecorator.php | 0 .../Dispatcher/FakeDispatcher.php | 0 .../Handler/ErroneousHandler.php | 0 .../Handler/FakeNullHandler.php | 0 .../Handler/FakeResponseHandler.php | 0 .../Handler/ReturnFooBarHandler.php | 0 .../Mapping/Request/FooEntity.php | 0 .../Mapping/Request/InvalidEntity.php | 0 .../Mapping/Request/NotEmptyEntity.php | 0 .../Mapping/Response/FooEntity.php | 0 .../Mapping/Response/InvalidEntity.php | 0 .../Mapping/Validator/SimpleEntity.php | 0 .../Negotiation/FooRenderer.php | 0 .../Negotiation/InvalidRenderer.php | 0 .../Psr/DummyLogger.php | 0 .../RequestBody/SimpleRequestBody.php | 0 .../ResponseEntity/CompoundResponseEntity.php | 0 .../ResponseEntity/EmptyResponseEntity.php | 0 .../NativeIntersectionEntity.php | 0 .../ResponseEntity/NativeUnionEntity.php | 0 .../ResponseEntity/SelfReferencingEntity.php | 0 .../ResponseEntity/SimpleResponseEntity.php | 0 .../ResponseEntity/TypedResponseEntity.php | 0 .../Router/FakeRouter.php | 0 tests/{toolkit => Toolkit}/NeonLoader.php | 0 129 files changed, 100 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/coverage.yml rename tests/{cases => Cases}/Console/Command/RouteDumpCommand.phpt (100%) rename tests/{cases => Cases}/Core/Adjuster/FileResponseAdjuster.phpt (100%) rename tests/{cases => Cases}/Core/Annotation/Controller/Id.phpt (100%) rename tests/{cases => Cases}/Core/Annotation/Controller/Method.phpt (100%) rename tests/{cases => Cases}/Core/Annotation/Controller/Negotiation.phpt (100%) rename tests/{cases => Cases}/Core/Annotation/Controller/Negotiations.phpt (100%) rename tests/{cases => Cases}/Core/Annotation/Controller/Path.phpt (100%) rename tests/{cases => Cases}/Core/Annotation/Controller/RequestBody.phpt (100%) rename tests/{cases => Cases}/Core/Annotation/Controller/RequestParameter.phpt (100%) rename tests/{cases => Cases}/Core/Annotation/Controller/RequestParameters.phpt (100%) rename tests/{cases => Cases}/Core/Annotation/Controller/Tag.phpt (100%) rename tests/{cases => Cases}/Core/DI/ApiExtension.phpt (100%) rename tests/{cases => Cases}/Core/DI/Loader/DoctrineAnnotationLoader.phpt (100%) rename tests/{cases => Cases}/Core/DI/Loader/DoctrineMultiAnnotationLoader.phpt (100%) rename tests/{cases => Cases}/Core/DI/Loader/MixedAttributeAnnotationLoader.phpt (100%) rename tests/{cases => Cases}/Core/Decorator/DecoratorManager.phpt (100%) rename tests/{cases => Cases}/Core/Dispatcher/CoreDispatcher.phpt (100%) rename tests/{cases => Cases}/Core/Dispatcher/DecoratedDispatcher.phpt (100%) rename tests/{cases => Cases}/Core/Dispatcher/JsonDispatcher.phpt (100%) rename tests/{cases => Cases}/Core/ErrorHandler/PsrLogErrorHandler.phpt (100%) rename tests/{cases => Cases}/Core/ErrorHandler/SimpleErrorHandler.phpt (100%) rename tests/{cases => Cases}/Core/Exception/ExceptionExtra.phpt (100%) rename tests/{cases => Cases}/Core/Handler/ServiceHandler.phpt (100%) rename tests/{cases => Cases}/Core/Http/ApiRequest.phpt (100%) rename tests/{cases => Cases}/Core/Mapping/Parameter/BooleanTypeMapper.phpt (100%) rename tests/{cases => Cases}/Core/Mapping/Parameter/DateTimeTypeMapper.phpt (100%) rename tests/{cases => Cases}/Core/Mapping/Parameter/FloatTypeMapper.phpt (100%) rename tests/{cases => Cases}/Core/Mapping/Parameter/IntegerTypeMapper.phpt (100%) rename tests/{cases => Cases}/Core/Mapping/Parameter/StringTypeMapper.phpt (100%) rename tests/{cases => Cases}/Core/Mapping/RequestEntityMapping.phpt (100%) rename tests/{cases => Cases}/Core/Mapping/RequestParameterMapping.phpt (100%) rename tests/{cases => Cases}/Core/Mapping/Validator/SymfonyValidator.phpt (100%) rename tests/{cases => Cases}/Core/Router/SimpleRouter.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Endpoint.phpt (100%) rename tests/{cases => Cases}/Core/Schema/SchemaBuilderTest.php (100%) rename tests/{cases => Cases}/Core/Schema/SchemaInspector.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Serialization/ArrayHydrator.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Serialization/ArraySerializator.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Validation/ControllerPathValidation.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Validation/ControllerValidation.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Validation/FullpathValidation.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Validation/GroupPathValidation.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Validation/IdValidation.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Validation/NegotiationValidation.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Validation/PathValidation.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Validation/RequestBodyValidation.phpt (100%) rename tests/{cases => Cases}/Core/Schema/Validation/RequestParameterValidation.phpt (100%) rename tests/{cases => Cases}/Core/Utils/Helpers.phpt (62%) rename tests/{cases => Cases}/Core/Utils/Regex.phpt (100%) rename tests/{cases => Cases}/Debug/Negotiation/Transformer/DebugDataTransformerTest.php (100%) rename tests/{cases => Cases}/Middlewares/ApiMiddleware.phpt (100%) rename tests/{cases => Cases}/Negotiation/SuffixNegotiator.phpt (100%) rename tests/{cases => Cases}/Negotiation/Transformer/CsvTransformer.phpt (100%) rename tests/{cases => Cases}/Negotiation/Transformer/JsonTransformer.phpt (100%) rename tests/{cases => Cases}/OpenApi/DI/OpenApiPlugin.phpt (100%) rename tests/{cases => Cases}/OpenApi/Schema/ContactTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/ExamplesTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/ExternalDocumentationTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/InfoTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/LicenseTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/MediaTypeTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/OperationTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/ParameterTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/RequestBodyTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/ResponseTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/ResponsesTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/ServerTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/ServerVariableTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/TagTest.php (100%) rename tests/{cases => Cases}/OpenApi/Schema/examples/api-with-examples.yaml (100%) rename tests/{cases => Cases}/OpenApi/Schema/examples/callback-example.yaml (100%) rename tests/{cases => Cases}/OpenApi/Schema/examples/link-example.yaml (100%) rename tests/{cases => Cases}/OpenApi/Schema/examples/petstore-expanded.yaml (100%) rename tests/{cases => Cases}/OpenApi/Schema/examples/petstore.yaml (100%) rename tests/{cases => Cases}/OpenApi/Schema/examples/uspto.yaml (100%) rename tests/{cases => Cases}/OpenApi/SchemaBuilderTest.php (100%) rename tests/{cases => Cases}/OpenApi/SchemaDefinition/CoreDefinitionTest.php (100%) rename tests/{cases => Cases}/OpenApi/SchemaDefinition/Entity/EntityAdapterTest.php (100%) rename tests/{cases => Cases}/OpenApi/SchemaType/BaseSchemaTypeTest.php (100%) rename tests/{cases => Cases}/Presenter/ApiRouteTest.phpt (100%) rename tests/{fixtures => Fixtures}/Controllers/AbstractController.php (100%) rename tests/{fixtures => Fixtures}/Controllers/AnnotationFoobarController.php (100%) rename tests/{fixtures => Fixtures}/Controllers/AnnotationMultiController.php (100%) rename tests/{fixtures => Fixtures}/Controllers/ApiV1Controller.php (100%) rename tests/{fixtures => Fixtures}/Controllers/AttributeFoobarController.php (100%) rename tests/{fixtures => Fixtures}/Controllers/AttributeMultiController.php (100%) rename tests/{fixtures => Fixtures}/Controllers/Mixed/AnnotationAttributeController.php (100%) rename tests/{fixtures => Fixtures}/Controllers/Mixed/AttributesOnlyController.php (69%) rename tests/{fixtures => Fixtures}/Controllers/Mixed/PathAndRequestParamsController.php (95%) rename tests/{fixtures => Fixtures}/Decorator/EarlyReturnResponseExceptionDecorator.php (100%) rename tests/{fixtures => Fixtures}/Decorator/RethrowErrorDecorator.php (100%) rename tests/{fixtures => Fixtures}/Decorator/ReturnRequestDecorator.php (100%) rename tests/{fixtures => Fixtures}/Decorator/ReturnResponseDecorator.php (100%) rename tests/{fixtures => Fixtures}/Dispatcher/FakeDispatcher.php (100%) rename tests/{fixtures => Fixtures}/Handler/ErroneousHandler.php (100%) rename tests/{fixtures => Fixtures}/Handler/FakeNullHandler.php (100%) rename tests/{fixtures => Fixtures}/Handler/FakeResponseHandler.php (100%) rename tests/{fixtures => Fixtures}/Handler/ReturnFooBarHandler.php (100%) rename tests/{fixtures => Fixtures}/Mapping/Request/FooEntity.php (100%) rename tests/{fixtures => Fixtures}/Mapping/Request/InvalidEntity.php (100%) rename tests/{fixtures => Fixtures}/Mapping/Request/NotEmptyEntity.php (100%) rename tests/{fixtures => Fixtures}/Mapping/Response/FooEntity.php (100%) rename tests/{fixtures => Fixtures}/Mapping/Response/InvalidEntity.php (100%) rename tests/{fixtures => Fixtures}/Mapping/Validator/SimpleEntity.php (100%) rename tests/{fixtures => Fixtures}/Negotiation/FooRenderer.php (100%) rename tests/{fixtures => Fixtures}/Negotiation/InvalidRenderer.php (100%) rename tests/{fixtures => Fixtures}/Psr/DummyLogger.php (100%) rename tests/{fixtures => Fixtures}/RequestBody/SimpleRequestBody.php (100%) rename tests/{fixtures => Fixtures}/ResponseEntity/CompoundResponseEntity.php (100%) rename tests/{fixtures => Fixtures}/ResponseEntity/EmptyResponseEntity.php (100%) rename tests/{fixtures => Fixtures}/ResponseEntity/NativeIntersectionEntity.php (100%) rename tests/{fixtures => Fixtures}/ResponseEntity/NativeUnionEntity.php (100%) rename tests/{fixtures => Fixtures}/ResponseEntity/SelfReferencingEntity.php (100%) rename tests/{fixtures => Fixtures}/ResponseEntity/SimpleResponseEntity.php (100%) rename tests/{fixtures => Fixtures}/ResponseEntity/TypedResponseEntity.php (100%) rename tests/{fixtures => Fixtures}/Router/FakeRouter.php (100%) rename tests/{toolkit => Toolkit}/NeonLoader.php (100%) diff --git a/.github/workflows/codesniffer.yml b/.github/workflows/codesniffer.yml index f4638671..dfc76ff5 100644 --- a/.github/workflows/codesniffer.yml +++ b/.github/workflows/codesniffer.yml @@ -10,8 +10,6 @@ on: - cron: "0 8 * * 1" jobs: - build: + codesniffer: name: "Codesniffer" uses: contributte/.github/.github/workflows/codesniffer.yml@v1 - with: - php: "8.0" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..6db10008 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,17 @@ +name: "Coverage" + +on: + pull_request: + + push: + branches: ["*"] + + schedule: + - cron: "0 8 * * 1" + +jobs: + test80: + name: "Nette Tester" + uses: contributte/.github/.github/workflows/nette-tester-coverage.yml@v1 + with: + php: "8.0" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 42162c5c..db3ad34f 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -10,8 +10,6 @@ on: - cron: "0 8 * * 1" jobs: - build: + phpstan: name: "Phpstan" uses: contributte/.github/.github/workflows/phpstan.yml@v1 - with: - php: "8.0" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 29587214..4d0fa19b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,20 +10,27 @@ on: - cron: "0 8 * * 1" jobs: - build81: + test81: name: "Nette Tester" uses: contributte/.github/.github/workflows/nette-tester.yml@v1 with: - php: "8.0" + php: "8.1" - build80: + test80: name: "Nette Tester" uses: contributte/.github/.github/workflows/nette-tester.yml@v1 with: php: "8.0" - build74: + test74: name: "Nette Tester" uses: contributte/.github/.github/workflows/nette-tester.yml@v1 with: php: "7.4" + + test74-lower: + name: "Nette Tester" + uses: contributte/.github/.github/workflows/nette-tester.yml@v1 + with: + php: "7.4" + composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable --prefer-lowest" diff --git a/Makefile b/Makefile index bb258dd4..7a0e38f6 100644 --- a/Makefile +++ b/Makefile @@ -16,14 +16,14 @@ csf: vendor/bin/codefixer src tests phpstan: - vendor/bin/phpstan analyse -l max -c phpstan.neon src + vendor/bin/phpstan analyse -c phpstan.neon tests: - vendor/bin/tester -s -p php --colors 1 -C tests/cases + vendor/bin/tester -s -p php --colors 1 -C tests/Cases coverage: ifdef GITHUB_ACTION - vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/cases + vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases else - vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/cases + vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases endif diff --git a/composer.json b/composer.json index f144f4bc..0f7eca4a 100644 --- a/composer.json +++ b/composer.json @@ -19,26 +19,26 @@ } ], "require": { - "php": ">=7.4", + "php": ">=7.3", "ext-json": "*", "contributte/psr7-http-message": "~0.7.0", "contributte/middlewares": "^0.10.0", "doctrine/annotations": "^1.13", "koriym/attributes": "^1.0.2", - "nette/utils": "^3.2" + "nette/utils": "^3.2.7" }, "require-dev": { - "mockery/mockery": "^1.1.0", + "mockery/mockery": "^1.5.0", "nette/application": "^3.0.0", "nette/di": "^3.0.0", "nette/http": "^3.0.1", "nettrine/annotations": "^0.7.0", "ninjify/nunjuck": "^0.4", "ninjify/qa": "^0.13", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-deprecation-rules": "^0.12", - "phpstan/phpstan-nette": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", + "phpstan/phpstan": "^1.0.0", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-nette": "^1.0.0", + "phpstan/phpstan-strict-rules": "^1.0.0", "psr/log": "^1.1|^2.0|^3.0", "symfony/console": "^5.4.3 || ^6.0.0", "symfony/validator": "^5.4.3 || ^6.0", @@ -46,7 +46,7 @@ "tracy/tracy": "^2.6.0" }, "conflict": { - "nette/di": "<=3.0.0-RC" + "nette/tester": "<2.4.1" }, "provide": { "psr/http-message-implementation": "1.0" @@ -58,8 +58,7 @@ }, "autoload-dev": { "psr-4": { - "Tests\\Fixtures\\": "tests/fixtures", - "Tests\\Toolkit\\": "tests/toolkit" + "Tests\\": "tests" } }, "minimum-stability": "dev", diff --git a/phpstan.neon b/phpstan.neon index 3d7fd8a9..75e34c7a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,8 +5,15 @@ includes: - vendor/phpstan/phpstan-strict-rules/rules.neon parameters: - # @todo + level: 8 + phpVersion: 70400 + + paths: + - src + + reportMaybesInPropertyPhpDocTypes: false checkGenericClassInNonGenericObjectType: false + ignoreErrors: # deprecated with no replacement until 2.0.0 - '#^Call to deprecated method registerUniqueLoader\(\) of class Doctrine\\Common\\Annotations\\AnnotationRegistry.+#' @@ -16,7 +23,6 @@ parameters: - '#^Variable property access on Apitte\\Core\\Mapping\\Request\\BasicEntity\.$#' # Phpstan bug - - '#^Parameter \#1 (.*?) of function call_user_func expects callable\(\)\: mixed, array\(Apitte\\Core\\UI\\Controller\\IController, string\) given\.$#' - message: '#^Parameter \#1 \$argument of class ReflectionClass constructor expects class-string|T of object, string given\.$#' path: %currentWorkingDirectory%/src/Core/DI/Loader/DoctrineAnnotationLoader.php @@ -43,3 +49,6 @@ parameters: path: %currentWorkingDirectory%/src/OpenApi/SchemaDefinition/Entity/EntityAdapter.php - '#Unable to resolve the template type T in call to method Nette\\DI\\Container::getByType\(\)#' + + - '#Property Apitte\\OpenApi\\Schema\\(\w+)::\$(\w+) is never read, only written.#' + - '#Property Apitte\\OpenApi\\Schema\\(\w+)::\$(\w+) is unused.#' diff --git a/ruleset.xml b/ruleset.xml index 565eea48..c8938932 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -12,39 +12,31 @@ - - - - + + - - src/Exception/ExceptionExtra.php - - - tests/fixtures/Controllers/AttributeFoobarController.php - tests/fixtures/Controllers/AttributeMultiController.php + tests/Fixtures/Controllers/AttributeFoobarController.php + tests/Fixtures/Controllers/AttributeMultiController.php - *tests/cases/* + *tests/Cases/* - *tests/cases/* + *tests/Cases/* - *tests/cases/* + *tests/Cases/* /tests/tmp - - - /tests/fixtures/Controllers/*.php + diff --git a/src/Core/DI/Plugin/CoreSchemaPlugin.php b/src/Core/DI/Plugin/CoreSchemaPlugin.php index 104a1afd..7a8d3ff6 100644 --- a/src/Core/DI/Plugin/CoreSchemaPlugin.php +++ b/src/Core/DI/Plugin/CoreSchemaPlugin.php @@ -13,6 +13,7 @@ use Apitte\Core\Schema\Validation\FullpathValidation; use Apitte\Core\Schema\Validation\GroupPathValidation; use Apitte\Core\Schema\Validation\IdValidation; +use Apitte\Core\Schema\Validation\IValidation; use Apitte\Core\Schema\Validation\NegotiationValidation; use Apitte\Core\Schema\Validation\PathValidation; use Apitte\Core\Schema\Validation\RequestBodyValidation; @@ -146,6 +147,7 @@ protected function validateSchema(SchemaBuilder $builder): SchemaBuilder $validator = new SchemaBuilderValidator(); // Add all validators at compile-time + /** @var class-string $validation */ foreach ($validations as $validation) { $validator->add(new $validation()); } diff --git a/src/Core/Handler/ServiceCallback.php b/src/Core/Handler/ServiceCallback.php index c05495cc..ac6c0252 100644 --- a/src/Core/Handler/ServiceCallback.php +++ b/src/Core/Handler/ServiceCallback.php @@ -3,6 +3,7 @@ namespace Apitte\Core\Handler; use Apitte\Core\UI\Controller\IController; +use Apitte\Core\Utils\Helpers; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -36,7 +37,7 @@ public function getMethod(): string */ public function __invoke(ServerRequestInterface $request, ResponseInterface $response) { - return call_user_func([$this->service, $this->method], $request, $response); + return call_user_func(Helpers::callback([$this->service, $this->method]), $request, $response); } } diff --git a/src/Core/Mapping/RequestParameterMapping.php b/src/Core/Mapping/RequestParameterMapping.php index be32dad7..dcf0a8a3 100644 --- a/src/Core/Mapping/RequestParameterMapping.php +++ b/src/Core/Mapping/RequestParameterMapping.php @@ -24,11 +24,11 @@ class RequestParameterMapping InvalidArgumentTypeException::TYPE_DATETIME => '%s request parameter "%s" should be of type datetime in format ISO 8601 (Y-m-d\TH:i:sP).', ]; - /** @var string[]|ITypeMapper[] */ + /** @var array> */ protected $types = []; /** - * @param string|ITypeMapper $mapper + * @param ITypeMapper|string $mapper */ public function addMapper(string $type, $mapper): void { @@ -223,14 +223,12 @@ protected function getMapper(string $type): ?ITypeMapper return null; } - $mapper = $this->types[$type]; - // Initialize mapper - if (!is_object($mapper)) { - $this->types[$type] = $mapper = new $mapper(); + if (!($this->types[$type] instanceof ITypeMapper)) { + $this->types[$type] = new $this->types[$type](); } - return $mapper; + return $this->types[$type]; } } diff --git a/src/Core/Utils/Helpers.php b/src/Core/Utils/Helpers.php index 4b659b41..5b9e5dfc 100644 --- a/src/Core/Utils/Helpers.php +++ b/src/Core/Utils/Helpers.php @@ -2,6 +2,8 @@ namespace Apitte\Core\Utils; +use Apitte\Core\Exception\Logical\InvalidArgumentException; + final class Helpers { @@ -10,4 +12,16 @@ public static function slashless(string $str): string return Regex::replace($str, '#/{2,}#', '/'); } + /** + * @param array{object,string} $callback + */ + public static function callback(array $callback): callable + { + if (!is_callable($callback)) { + throw new InvalidArgumentException('Invalid callback given'); + } + + return $callback; + } + } diff --git a/tests/cases/Console/Command/RouteDumpCommand.phpt b/tests/Cases/Console/Command/RouteDumpCommand.phpt similarity index 100% rename from tests/cases/Console/Command/RouteDumpCommand.phpt rename to tests/Cases/Console/Command/RouteDumpCommand.phpt diff --git a/tests/cases/Core/Adjuster/FileResponseAdjuster.phpt b/tests/Cases/Core/Adjuster/FileResponseAdjuster.phpt similarity index 100% rename from tests/cases/Core/Adjuster/FileResponseAdjuster.phpt rename to tests/Cases/Core/Adjuster/FileResponseAdjuster.phpt diff --git a/tests/cases/Core/Annotation/Controller/Id.phpt b/tests/Cases/Core/Annotation/Controller/Id.phpt similarity index 100% rename from tests/cases/Core/Annotation/Controller/Id.phpt rename to tests/Cases/Core/Annotation/Controller/Id.phpt diff --git a/tests/cases/Core/Annotation/Controller/Method.phpt b/tests/Cases/Core/Annotation/Controller/Method.phpt similarity index 100% rename from tests/cases/Core/Annotation/Controller/Method.phpt rename to tests/Cases/Core/Annotation/Controller/Method.phpt diff --git a/tests/cases/Core/Annotation/Controller/Negotiation.phpt b/tests/Cases/Core/Annotation/Controller/Negotiation.phpt similarity index 100% rename from tests/cases/Core/Annotation/Controller/Negotiation.phpt rename to tests/Cases/Core/Annotation/Controller/Negotiation.phpt diff --git a/tests/cases/Core/Annotation/Controller/Negotiations.phpt b/tests/Cases/Core/Annotation/Controller/Negotiations.phpt similarity index 100% rename from tests/cases/Core/Annotation/Controller/Negotiations.phpt rename to tests/Cases/Core/Annotation/Controller/Negotiations.phpt diff --git a/tests/cases/Core/Annotation/Controller/Path.phpt b/tests/Cases/Core/Annotation/Controller/Path.phpt similarity index 100% rename from tests/cases/Core/Annotation/Controller/Path.phpt rename to tests/Cases/Core/Annotation/Controller/Path.phpt diff --git a/tests/cases/Core/Annotation/Controller/RequestBody.phpt b/tests/Cases/Core/Annotation/Controller/RequestBody.phpt similarity index 100% rename from tests/cases/Core/Annotation/Controller/RequestBody.phpt rename to tests/Cases/Core/Annotation/Controller/RequestBody.phpt diff --git a/tests/cases/Core/Annotation/Controller/RequestParameter.phpt b/tests/Cases/Core/Annotation/Controller/RequestParameter.phpt similarity index 100% rename from tests/cases/Core/Annotation/Controller/RequestParameter.phpt rename to tests/Cases/Core/Annotation/Controller/RequestParameter.phpt diff --git a/tests/cases/Core/Annotation/Controller/RequestParameters.phpt b/tests/Cases/Core/Annotation/Controller/RequestParameters.phpt similarity index 100% rename from tests/cases/Core/Annotation/Controller/RequestParameters.phpt rename to tests/Cases/Core/Annotation/Controller/RequestParameters.phpt diff --git a/tests/cases/Core/Annotation/Controller/Tag.phpt b/tests/Cases/Core/Annotation/Controller/Tag.phpt similarity index 100% rename from tests/cases/Core/Annotation/Controller/Tag.phpt rename to tests/Cases/Core/Annotation/Controller/Tag.phpt diff --git a/tests/cases/Core/DI/ApiExtension.phpt b/tests/Cases/Core/DI/ApiExtension.phpt similarity index 100% rename from tests/cases/Core/DI/ApiExtension.phpt rename to tests/Cases/Core/DI/ApiExtension.phpt diff --git a/tests/cases/Core/DI/Loader/DoctrineAnnotationLoader.phpt b/tests/Cases/Core/DI/Loader/DoctrineAnnotationLoader.phpt similarity index 100% rename from tests/cases/Core/DI/Loader/DoctrineAnnotationLoader.phpt rename to tests/Cases/Core/DI/Loader/DoctrineAnnotationLoader.phpt diff --git a/tests/cases/Core/DI/Loader/DoctrineMultiAnnotationLoader.phpt b/tests/Cases/Core/DI/Loader/DoctrineMultiAnnotationLoader.phpt similarity index 100% rename from tests/cases/Core/DI/Loader/DoctrineMultiAnnotationLoader.phpt rename to tests/Cases/Core/DI/Loader/DoctrineMultiAnnotationLoader.phpt diff --git a/tests/cases/Core/DI/Loader/MixedAttributeAnnotationLoader.phpt b/tests/Cases/Core/DI/Loader/MixedAttributeAnnotationLoader.phpt similarity index 100% rename from tests/cases/Core/DI/Loader/MixedAttributeAnnotationLoader.phpt rename to tests/Cases/Core/DI/Loader/MixedAttributeAnnotationLoader.phpt diff --git a/tests/cases/Core/Decorator/DecoratorManager.phpt b/tests/Cases/Core/Decorator/DecoratorManager.phpt similarity index 100% rename from tests/cases/Core/Decorator/DecoratorManager.phpt rename to tests/Cases/Core/Decorator/DecoratorManager.phpt diff --git a/tests/cases/Core/Dispatcher/CoreDispatcher.phpt b/tests/Cases/Core/Dispatcher/CoreDispatcher.phpt similarity index 100% rename from tests/cases/Core/Dispatcher/CoreDispatcher.phpt rename to tests/Cases/Core/Dispatcher/CoreDispatcher.phpt diff --git a/tests/cases/Core/Dispatcher/DecoratedDispatcher.phpt b/tests/Cases/Core/Dispatcher/DecoratedDispatcher.phpt similarity index 100% rename from tests/cases/Core/Dispatcher/DecoratedDispatcher.phpt rename to tests/Cases/Core/Dispatcher/DecoratedDispatcher.phpt diff --git a/tests/cases/Core/Dispatcher/JsonDispatcher.phpt b/tests/Cases/Core/Dispatcher/JsonDispatcher.phpt similarity index 100% rename from tests/cases/Core/Dispatcher/JsonDispatcher.phpt rename to tests/Cases/Core/Dispatcher/JsonDispatcher.phpt diff --git a/tests/cases/Core/ErrorHandler/PsrLogErrorHandler.phpt b/tests/Cases/Core/ErrorHandler/PsrLogErrorHandler.phpt similarity index 100% rename from tests/cases/Core/ErrorHandler/PsrLogErrorHandler.phpt rename to tests/Cases/Core/ErrorHandler/PsrLogErrorHandler.phpt diff --git a/tests/cases/Core/ErrorHandler/SimpleErrorHandler.phpt b/tests/Cases/Core/ErrorHandler/SimpleErrorHandler.phpt similarity index 100% rename from tests/cases/Core/ErrorHandler/SimpleErrorHandler.phpt rename to tests/Cases/Core/ErrorHandler/SimpleErrorHandler.phpt diff --git a/tests/cases/Core/Exception/ExceptionExtra.phpt b/tests/Cases/Core/Exception/ExceptionExtra.phpt similarity index 100% rename from tests/cases/Core/Exception/ExceptionExtra.phpt rename to tests/Cases/Core/Exception/ExceptionExtra.phpt diff --git a/tests/cases/Core/Handler/ServiceHandler.phpt b/tests/Cases/Core/Handler/ServiceHandler.phpt similarity index 100% rename from tests/cases/Core/Handler/ServiceHandler.phpt rename to tests/Cases/Core/Handler/ServiceHandler.phpt diff --git a/tests/cases/Core/Http/ApiRequest.phpt b/tests/Cases/Core/Http/ApiRequest.phpt similarity index 100% rename from tests/cases/Core/Http/ApiRequest.phpt rename to tests/Cases/Core/Http/ApiRequest.phpt diff --git a/tests/cases/Core/Mapping/Parameter/BooleanTypeMapper.phpt b/tests/Cases/Core/Mapping/Parameter/BooleanTypeMapper.phpt similarity index 100% rename from tests/cases/Core/Mapping/Parameter/BooleanTypeMapper.phpt rename to tests/Cases/Core/Mapping/Parameter/BooleanTypeMapper.phpt diff --git a/tests/cases/Core/Mapping/Parameter/DateTimeTypeMapper.phpt b/tests/Cases/Core/Mapping/Parameter/DateTimeTypeMapper.phpt similarity index 100% rename from tests/cases/Core/Mapping/Parameter/DateTimeTypeMapper.phpt rename to tests/Cases/Core/Mapping/Parameter/DateTimeTypeMapper.phpt diff --git a/tests/cases/Core/Mapping/Parameter/FloatTypeMapper.phpt b/tests/Cases/Core/Mapping/Parameter/FloatTypeMapper.phpt similarity index 100% rename from tests/cases/Core/Mapping/Parameter/FloatTypeMapper.phpt rename to tests/Cases/Core/Mapping/Parameter/FloatTypeMapper.phpt diff --git a/tests/cases/Core/Mapping/Parameter/IntegerTypeMapper.phpt b/tests/Cases/Core/Mapping/Parameter/IntegerTypeMapper.phpt similarity index 100% rename from tests/cases/Core/Mapping/Parameter/IntegerTypeMapper.phpt rename to tests/Cases/Core/Mapping/Parameter/IntegerTypeMapper.phpt diff --git a/tests/cases/Core/Mapping/Parameter/StringTypeMapper.phpt b/tests/Cases/Core/Mapping/Parameter/StringTypeMapper.phpt similarity index 100% rename from tests/cases/Core/Mapping/Parameter/StringTypeMapper.phpt rename to tests/Cases/Core/Mapping/Parameter/StringTypeMapper.phpt diff --git a/tests/cases/Core/Mapping/RequestEntityMapping.phpt b/tests/Cases/Core/Mapping/RequestEntityMapping.phpt similarity index 100% rename from tests/cases/Core/Mapping/RequestEntityMapping.phpt rename to tests/Cases/Core/Mapping/RequestEntityMapping.phpt diff --git a/tests/cases/Core/Mapping/RequestParameterMapping.phpt b/tests/Cases/Core/Mapping/RequestParameterMapping.phpt similarity index 100% rename from tests/cases/Core/Mapping/RequestParameterMapping.phpt rename to tests/Cases/Core/Mapping/RequestParameterMapping.phpt diff --git a/tests/cases/Core/Mapping/Validator/SymfonyValidator.phpt b/tests/Cases/Core/Mapping/Validator/SymfonyValidator.phpt similarity index 100% rename from tests/cases/Core/Mapping/Validator/SymfonyValidator.phpt rename to tests/Cases/Core/Mapping/Validator/SymfonyValidator.phpt diff --git a/tests/cases/Core/Router/SimpleRouter.phpt b/tests/Cases/Core/Router/SimpleRouter.phpt similarity index 100% rename from tests/cases/Core/Router/SimpleRouter.phpt rename to tests/Cases/Core/Router/SimpleRouter.phpt diff --git a/tests/cases/Core/Schema/Endpoint.phpt b/tests/Cases/Core/Schema/Endpoint.phpt similarity index 100% rename from tests/cases/Core/Schema/Endpoint.phpt rename to tests/Cases/Core/Schema/Endpoint.phpt diff --git a/tests/cases/Core/Schema/SchemaBuilderTest.php b/tests/Cases/Core/Schema/SchemaBuilderTest.php similarity index 100% rename from tests/cases/Core/Schema/SchemaBuilderTest.php rename to tests/Cases/Core/Schema/SchemaBuilderTest.php diff --git a/tests/cases/Core/Schema/SchemaInspector.phpt b/tests/Cases/Core/Schema/SchemaInspector.phpt similarity index 100% rename from tests/cases/Core/Schema/SchemaInspector.phpt rename to tests/Cases/Core/Schema/SchemaInspector.phpt diff --git a/tests/cases/Core/Schema/Serialization/ArrayHydrator.phpt b/tests/Cases/Core/Schema/Serialization/ArrayHydrator.phpt similarity index 100% rename from tests/cases/Core/Schema/Serialization/ArrayHydrator.phpt rename to tests/Cases/Core/Schema/Serialization/ArrayHydrator.phpt diff --git a/tests/cases/Core/Schema/Serialization/ArraySerializator.phpt b/tests/Cases/Core/Schema/Serialization/ArraySerializator.phpt similarity index 100% rename from tests/cases/Core/Schema/Serialization/ArraySerializator.phpt rename to tests/Cases/Core/Schema/Serialization/ArraySerializator.phpt diff --git a/tests/cases/Core/Schema/Validation/ControllerPathValidation.phpt b/tests/Cases/Core/Schema/Validation/ControllerPathValidation.phpt similarity index 100% rename from tests/cases/Core/Schema/Validation/ControllerPathValidation.phpt rename to tests/Cases/Core/Schema/Validation/ControllerPathValidation.phpt diff --git a/tests/cases/Core/Schema/Validation/ControllerValidation.phpt b/tests/Cases/Core/Schema/Validation/ControllerValidation.phpt similarity index 100% rename from tests/cases/Core/Schema/Validation/ControllerValidation.phpt rename to tests/Cases/Core/Schema/Validation/ControllerValidation.phpt diff --git a/tests/cases/Core/Schema/Validation/FullpathValidation.phpt b/tests/Cases/Core/Schema/Validation/FullpathValidation.phpt similarity index 100% rename from tests/cases/Core/Schema/Validation/FullpathValidation.phpt rename to tests/Cases/Core/Schema/Validation/FullpathValidation.phpt diff --git a/tests/cases/Core/Schema/Validation/GroupPathValidation.phpt b/tests/Cases/Core/Schema/Validation/GroupPathValidation.phpt similarity index 100% rename from tests/cases/Core/Schema/Validation/GroupPathValidation.phpt rename to tests/Cases/Core/Schema/Validation/GroupPathValidation.phpt diff --git a/tests/cases/Core/Schema/Validation/IdValidation.phpt b/tests/Cases/Core/Schema/Validation/IdValidation.phpt similarity index 100% rename from tests/cases/Core/Schema/Validation/IdValidation.phpt rename to tests/Cases/Core/Schema/Validation/IdValidation.phpt diff --git a/tests/cases/Core/Schema/Validation/NegotiationValidation.phpt b/tests/Cases/Core/Schema/Validation/NegotiationValidation.phpt similarity index 100% rename from tests/cases/Core/Schema/Validation/NegotiationValidation.phpt rename to tests/Cases/Core/Schema/Validation/NegotiationValidation.phpt diff --git a/tests/cases/Core/Schema/Validation/PathValidation.phpt b/tests/Cases/Core/Schema/Validation/PathValidation.phpt similarity index 100% rename from tests/cases/Core/Schema/Validation/PathValidation.phpt rename to tests/Cases/Core/Schema/Validation/PathValidation.phpt diff --git a/tests/cases/Core/Schema/Validation/RequestBodyValidation.phpt b/tests/Cases/Core/Schema/Validation/RequestBodyValidation.phpt similarity index 100% rename from tests/cases/Core/Schema/Validation/RequestBodyValidation.phpt rename to tests/Cases/Core/Schema/Validation/RequestBodyValidation.phpt diff --git a/tests/cases/Core/Schema/Validation/RequestParameterValidation.phpt b/tests/Cases/Core/Schema/Validation/RequestParameterValidation.phpt similarity index 100% rename from tests/cases/Core/Schema/Validation/RequestParameterValidation.phpt rename to tests/Cases/Core/Schema/Validation/RequestParameterValidation.phpt diff --git a/tests/cases/Core/Utils/Helpers.phpt b/tests/Cases/Core/Utils/Helpers.phpt similarity index 62% rename from tests/cases/Core/Utils/Helpers.phpt rename to tests/Cases/Core/Utils/Helpers.phpt index 4f796a51..8c1714e0 100644 --- a/tests/cases/Core/Utils/Helpers.phpt +++ b/tests/Cases/Core/Utils/Helpers.phpt @@ -6,6 +6,7 @@ require_once __DIR__ . '/../../../bootstrap.php'; +use Apitte\Core\Exception\Logical\InvalidArgumentException; use Apitte\Core\Utils\Helpers; use Tester\Assert; @@ -19,3 +20,12 @@ test(function (): void { Assert::equal('/foo/', Helpers::slashless('/foo/')); Assert::equal('/foo/', Helpers::slashless('//foo//')); }); + +// Helpers::callback +test(function (): void { + Assert::type('callable', Helpers::callback([Helpers::class, 'callback'])); + + Assert::exception(static function (): void { + Assert::type('callable', Helpers::callback([Helpers::class, 'fake'])); + }, InvalidArgumentException::class); +}); diff --git a/tests/cases/Core/Utils/Regex.phpt b/tests/Cases/Core/Utils/Regex.phpt similarity index 100% rename from tests/cases/Core/Utils/Regex.phpt rename to tests/Cases/Core/Utils/Regex.phpt diff --git a/tests/cases/Debug/Negotiation/Transformer/DebugDataTransformerTest.php b/tests/Cases/Debug/Negotiation/Transformer/DebugDataTransformerTest.php similarity index 100% rename from tests/cases/Debug/Negotiation/Transformer/DebugDataTransformerTest.php rename to tests/Cases/Debug/Negotiation/Transformer/DebugDataTransformerTest.php diff --git a/tests/cases/Middlewares/ApiMiddleware.phpt b/tests/Cases/Middlewares/ApiMiddleware.phpt similarity index 100% rename from tests/cases/Middlewares/ApiMiddleware.phpt rename to tests/Cases/Middlewares/ApiMiddleware.phpt diff --git a/tests/cases/Negotiation/SuffixNegotiator.phpt b/tests/Cases/Negotiation/SuffixNegotiator.phpt similarity index 100% rename from tests/cases/Negotiation/SuffixNegotiator.phpt rename to tests/Cases/Negotiation/SuffixNegotiator.phpt diff --git a/tests/cases/Negotiation/Transformer/CsvTransformer.phpt b/tests/Cases/Negotiation/Transformer/CsvTransformer.phpt similarity index 100% rename from tests/cases/Negotiation/Transformer/CsvTransformer.phpt rename to tests/Cases/Negotiation/Transformer/CsvTransformer.phpt diff --git a/tests/cases/Negotiation/Transformer/JsonTransformer.phpt b/tests/Cases/Negotiation/Transformer/JsonTransformer.phpt similarity index 100% rename from tests/cases/Negotiation/Transformer/JsonTransformer.phpt rename to tests/Cases/Negotiation/Transformer/JsonTransformer.phpt diff --git a/tests/cases/OpenApi/DI/OpenApiPlugin.phpt b/tests/Cases/OpenApi/DI/OpenApiPlugin.phpt similarity index 100% rename from tests/cases/OpenApi/DI/OpenApiPlugin.phpt rename to tests/Cases/OpenApi/DI/OpenApiPlugin.phpt diff --git a/tests/cases/OpenApi/Schema/ContactTest.php b/tests/Cases/OpenApi/Schema/ContactTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/ContactTest.php rename to tests/Cases/OpenApi/Schema/ContactTest.php diff --git a/tests/cases/OpenApi/Schema/ExamplesTest.php b/tests/Cases/OpenApi/Schema/ExamplesTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/ExamplesTest.php rename to tests/Cases/OpenApi/Schema/ExamplesTest.php diff --git a/tests/cases/OpenApi/Schema/ExternalDocumentationTest.php b/tests/Cases/OpenApi/Schema/ExternalDocumentationTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/ExternalDocumentationTest.php rename to tests/Cases/OpenApi/Schema/ExternalDocumentationTest.php diff --git a/tests/cases/OpenApi/Schema/InfoTest.php b/tests/Cases/OpenApi/Schema/InfoTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/InfoTest.php rename to tests/Cases/OpenApi/Schema/InfoTest.php diff --git a/tests/cases/OpenApi/Schema/LicenseTest.php b/tests/Cases/OpenApi/Schema/LicenseTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/LicenseTest.php rename to tests/Cases/OpenApi/Schema/LicenseTest.php diff --git a/tests/cases/OpenApi/Schema/MediaTypeTest.php b/tests/Cases/OpenApi/Schema/MediaTypeTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/MediaTypeTest.php rename to tests/Cases/OpenApi/Schema/MediaTypeTest.php diff --git a/tests/cases/OpenApi/Schema/OperationTest.php b/tests/Cases/OpenApi/Schema/OperationTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/OperationTest.php rename to tests/Cases/OpenApi/Schema/OperationTest.php diff --git a/tests/cases/OpenApi/Schema/ParameterTest.php b/tests/Cases/OpenApi/Schema/ParameterTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/ParameterTest.php rename to tests/Cases/OpenApi/Schema/ParameterTest.php diff --git a/tests/cases/OpenApi/Schema/RequestBodyTest.php b/tests/Cases/OpenApi/Schema/RequestBodyTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/RequestBodyTest.php rename to tests/Cases/OpenApi/Schema/RequestBodyTest.php diff --git a/tests/cases/OpenApi/Schema/ResponseTest.php b/tests/Cases/OpenApi/Schema/ResponseTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/ResponseTest.php rename to tests/Cases/OpenApi/Schema/ResponseTest.php diff --git a/tests/cases/OpenApi/Schema/ResponsesTest.php b/tests/Cases/OpenApi/Schema/ResponsesTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/ResponsesTest.php rename to tests/Cases/OpenApi/Schema/ResponsesTest.php diff --git a/tests/cases/OpenApi/Schema/ServerTest.php b/tests/Cases/OpenApi/Schema/ServerTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/ServerTest.php rename to tests/Cases/OpenApi/Schema/ServerTest.php diff --git a/tests/cases/OpenApi/Schema/ServerVariableTest.php b/tests/Cases/OpenApi/Schema/ServerVariableTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/ServerVariableTest.php rename to tests/Cases/OpenApi/Schema/ServerVariableTest.php diff --git a/tests/cases/OpenApi/Schema/TagTest.php b/tests/Cases/OpenApi/Schema/TagTest.php similarity index 100% rename from tests/cases/OpenApi/Schema/TagTest.php rename to tests/Cases/OpenApi/Schema/TagTest.php diff --git a/tests/cases/OpenApi/Schema/examples/api-with-examples.yaml b/tests/Cases/OpenApi/Schema/examples/api-with-examples.yaml similarity index 100% rename from tests/cases/OpenApi/Schema/examples/api-with-examples.yaml rename to tests/Cases/OpenApi/Schema/examples/api-with-examples.yaml diff --git a/tests/cases/OpenApi/Schema/examples/callback-example.yaml b/tests/Cases/OpenApi/Schema/examples/callback-example.yaml similarity index 100% rename from tests/cases/OpenApi/Schema/examples/callback-example.yaml rename to tests/Cases/OpenApi/Schema/examples/callback-example.yaml diff --git a/tests/cases/OpenApi/Schema/examples/link-example.yaml b/tests/Cases/OpenApi/Schema/examples/link-example.yaml similarity index 100% rename from tests/cases/OpenApi/Schema/examples/link-example.yaml rename to tests/Cases/OpenApi/Schema/examples/link-example.yaml diff --git a/tests/cases/OpenApi/Schema/examples/petstore-expanded.yaml b/tests/Cases/OpenApi/Schema/examples/petstore-expanded.yaml similarity index 100% rename from tests/cases/OpenApi/Schema/examples/petstore-expanded.yaml rename to tests/Cases/OpenApi/Schema/examples/petstore-expanded.yaml diff --git a/tests/cases/OpenApi/Schema/examples/petstore.yaml b/tests/Cases/OpenApi/Schema/examples/petstore.yaml similarity index 100% rename from tests/cases/OpenApi/Schema/examples/petstore.yaml rename to tests/Cases/OpenApi/Schema/examples/petstore.yaml diff --git a/tests/cases/OpenApi/Schema/examples/uspto.yaml b/tests/Cases/OpenApi/Schema/examples/uspto.yaml similarity index 100% rename from tests/cases/OpenApi/Schema/examples/uspto.yaml rename to tests/Cases/OpenApi/Schema/examples/uspto.yaml diff --git a/tests/cases/OpenApi/SchemaBuilderTest.php b/tests/Cases/OpenApi/SchemaBuilderTest.php similarity index 100% rename from tests/cases/OpenApi/SchemaBuilderTest.php rename to tests/Cases/OpenApi/SchemaBuilderTest.php diff --git a/tests/cases/OpenApi/SchemaDefinition/CoreDefinitionTest.php b/tests/Cases/OpenApi/SchemaDefinition/CoreDefinitionTest.php similarity index 100% rename from tests/cases/OpenApi/SchemaDefinition/CoreDefinitionTest.php rename to tests/Cases/OpenApi/SchemaDefinition/CoreDefinitionTest.php diff --git a/tests/cases/OpenApi/SchemaDefinition/Entity/EntityAdapterTest.php b/tests/Cases/OpenApi/SchemaDefinition/Entity/EntityAdapterTest.php similarity index 100% rename from tests/cases/OpenApi/SchemaDefinition/Entity/EntityAdapterTest.php rename to tests/Cases/OpenApi/SchemaDefinition/Entity/EntityAdapterTest.php diff --git a/tests/cases/OpenApi/SchemaType/BaseSchemaTypeTest.php b/tests/Cases/OpenApi/SchemaType/BaseSchemaTypeTest.php similarity index 100% rename from tests/cases/OpenApi/SchemaType/BaseSchemaTypeTest.php rename to tests/Cases/OpenApi/SchemaType/BaseSchemaTypeTest.php diff --git a/tests/cases/Presenter/ApiRouteTest.phpt b/tests/Cases/Presenter/ApiRouteTest.phpt similarity index 100% rename from tests/cases/Presenter/ApiRouteTest.phpt rename to tests/Cases/Presenter/ApiRouteTest.phpt diff --git a/tests/fixtures/Controllers/AbstractController.php b/tests/Fixtures/Controllers/AbstractController.php similarity index 100% rename from tests/fixtures/Controllers/AbstractController.php rename to tests/Fixtures/Controllers/AbstractController.php diff --git a/tests/fixtures/Controllers/AnnotationFoobarController.php b/tests/Fixtures/Controllers/AnnotationFoobarController.php similarity index 100% rename from tests/fixtures/Controllers/AnnotationFoobarController.php rename to tests/Fixtures/Controllers/AnnotationFoobarController.php diff --git a/tests/fixtures/Controllers/AnnotationMultiController.php b/tests/Fixtures/Controllers/AnnotationMultiController.php similarity index 100% rename from tests/fixtures/Controllers/AnnotationMultiController.php rename to tests/Fixtures/Controllers/AnnotationMultiController.php diff --git a/tests/fixtures/Controllers/ApiV1Controller.php b/tests/Fixtures/Controllers/ApiV1Controller.php similarity index 100% rename from tests/fixtures/Controllers/ApiV1Controller.php rename to tests/Fixtures/Controllers/ApiV1Controller.php diff --git a/tests/fixtures/Controllers/AttributeFoobarController.php b/tests/Fixtures/Controllers/AttributeFoobarController.php similarity index 100% rename from tests/fixtures/Controllers/AttributeFoobarController.php rename to tests/Fixtures/Controllers/AttributeFoobarController.php diff --git a/tests/fixtures/Controllers/AttributeMultiController.php b/tests/Fixtures/Controllers/AttributeMultiController.php similarity index 100% rename from tests/fixtures/Controllers/AttributeMultiController.php rename to tests/Fixtures/Controllers/AttributeMultiController.php diff --git a/tests/fixtures/Controllers/Mixed/AnnotationAttributeController.php b/tests/Fixtures/Controllers/Mixed/AnnotationAttributeController.php similarity index 100% rename from tests/fixtures/Controllers/Mixed/AnnotationAttributeController.php rename to tests/Fixtures/Controllers/Mixed/AnnotationAttributeController.php diff --git a/tests/fixtures/Controllers/Mixed/AttributesOnlyController.php b/tests/Fixtures/Controllers/Mixed/AttributesOnlyController.php similarity index 69% rename from tests/fixtures/Controllers/Mixed/AttributesOnlyController.php rename to tests/Fixtures/Controllers/Mixed/AttributesOnlyController.php index 46642cd7..3fabbb29 100644 --- a/tests/fixtures/Controllers/Mixed/AttributesOnlyController.php +++ b/tests/Fixtures/Controllers/Mixed/AttributesOnlyController.php @@ -1,6 +1,4 @@ -