From 282bddef398cf2f68b4344f01a83f21a643881bb Mon Sep 17 00:00:00 2001 From: Hannes Bochmann Date: Mon, 25 Nov 2024 09:59:33 +0100 Subject: [PATCH] Cleanup fix cs and qs --- .github/workflows/phpci.yml | 12 ++++++++++++ .php-cs-fixer.php | 9 +++++++++ Classes/Controller/AbstractController.php | 1 + Classes/Controller/InterfaceController.php | 1 + Classes/Controller/Json.php | 1 + Classes/Model/Provider.php | 1 + Classes/Model/ProviderHolder.php | 1 + Classes/Model/Supplier.php | 1 + Classes/Provider/AbstractProvider.php | 1 + Classes/Provider/InterfaceProvider.php | 1 + Classes/Repository/Provider.php | 1 + Classes/Router/InterfaceRouter.php | 1 + Classes/Router/Respect.php | 1 + Classes/Routines/Auth/FeUser.php | 1 + Classes/Routines/Auth/InterfaceAuth.php | 1 + Classes/Routines/Auth/Ip.php | 1 + Classes/Routines/Exception.php | 1 + Classes/Routines/InterfaceRoute.php | 1 + Classes/Routines/InterfaceRouter.php | 1 + Classes/Routines/Log/MemTrack.php | 1 + Classes/Routines/Log/TimeTrack.php | 1 + Classes/Routines/PhpError.php | 1 + Classes/Routines/Through/Json.php | 1 + Classes/Transformer/InterfaceTransformer.php | 1 + Classes/Transformer/Simple.php | 1 + Classes/Utility/Composer.php | 1 + Classes/Utility/Config.php | 1 + Classes/Utility/Factory.php | 1 + Tests/Unit/Middleware/AuthResolverTest.php | 6 +++--- composer.json | 17 ++++++++++++++++- 30 files changed, 66 insertions(+), 4 deletions(-) diff --git a/.github/workflows/phpci.yml b/.github/workflows/phpci.yml index ad05d30..e7f9f19 100644 --- a/.github/workflows/phpci.yml +++ b/.github/workflows/phpci.yml @@ -21,6 +21,9 @@ jobs: php-version: - "7.4" - "8.0" + - "8.1" + - "8.2" + - "8.3" steps: - @@ -68,6 +71,9 @@ jobs: php-version: - "7.4" - "8.0" + - "8.1" + - "8.2" + - "8.3" steps: - @@ -118,6 +124,12 @@ jobs: php-version: "7.4" - typo3-version: "^11.5" php-version: "8.0" + - typo3-version: "^11.5" + php-version: "8.1" + - typo3-version: "^11.5" + php-version: "8.2" + - typo3-version: "^11.5" + php-version: "8.3" steps: - diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index c19389b..755f149 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -14,5 +14,14 @@ '@Symfony' => true, 'phpdoc_align' => false, 'no_superfluous_phpdoc_tags' => false, + 'trailing_comma_in_multiline' => [ + 'after_heredoc' => true, + // no support for "arguments" and "parameters" as we need support for PHP 7.4 + 'elements' => [ + 'array_destructuring', + 'arrays', + 'match', + ], + ], ]) ->setLineEnding("\n"); diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index 1bb2e49..f4f0ddf 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -1,4 +1,5 @@ rewind(); $request = new ServerRequest('/t3rest/login', 'POST', $body); - $requestHandler = new class() implements RequestHandlerInterface { + $requestHandler = new class implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { return new JsonResponse( @@ -85,7 +85,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface public function testNoProcessIfUriDoesNotMatch() { $request = new ServerRequest('/not/a/rest/api/endpoint', 'GET'); - $requestHandler = new class() implements RequestHandlerInterface { + $requestHandler = new class implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { return new NullResponse(); @@ -114,7 +114,7 @@ public function testProcessIfRedirect() $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] = 'basic '.base64_encode('foo:pass:word'); $request = new ServerRequest('/t3rest/login', 'POST'); - $requestHandler = new class() implements RequestHandlerInterface { + $requestHandler = new class implements RequestHandlerInterface { public function handle(ServerRequestInterface $request): ResponseInterface { return new JsonResponse( diff --git a/composer.json b/composer.json index d8420cc..aa973e4 100644 --- a/composer.json +++ b/composer.json @@ -83,7 +83,10 @@ ], "test:phpcompatibility": [ "@test:phpcompatibility:7.4", - "@test:phpcompatibility:8.0" + "@test:phpcompatibility:8.0", + "@test:phpcompatibility:8.1", + "@test:phpcompatibility:8.2", + "@test:phpcompatibility:8.3" ], "test:phpcompatibility:7.4": [ "[ -e .Build/bin/phpcs ] || composer update", @@ -93,6 +96,18 @@ "[ -e .Build/bin/phpcs ] || composer update", ".Build/bin/phpcs --ignore=.Build/*,./Resources/Private/PHP/Composer/respect/rest/tests/* -p . --standard=.Build/vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.0" ], + "test:phpcompatibility:8.1": [ + "[ -e .Build/bin/phpcs ] || composer update", + ".Build/bin/phpcs --ignore=.Build/*,./Resources/Private/PHP/Composer/respect/rest/tests/* -p . --standard=.Build/vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.1" + ], + "test:phpcompatibility:8.2": [ + "[ -e .Build/bin/phpcs ] || composer update", + ".Build/bin/phpcs --ignore=.Build/*,./Resources/Private/PHP/Composer/respect/rest/tests/* -p . --standard=.Build/vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.2" + ], + "test:phpcompatibility:8.3": [ + "[ -e .Build/bin/phpcs ] || composer update", + ".Build/bin/phpcs --ignore=.Build/*,./Resources/Private/PHP/Composer/respect/rest/tests/* -p . --standard=.Build/vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.3" + ], "test:phpunit": [ "[ -e .Build/bin/phpunit ] || composer update --ansi", "export TYPO3_PATH_WEB=$PWD/.Build/Web && .Build/bin/phpunit -c phpunit.xml.dist --colors=always"