From 69bd32b78f883cf286d0e4dcdf3a72f304e6d615 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Mon, 26 Aug 2024 11:05:40 +0200 Subject: [PATCH] Aktualisiere PHP-CS-Fixer auf v3.62.0 (#36) --- .github/workflows/fix-cs-php.yml | 2 +- src/Controller/GuideController.php | 2 +- src/Handler/EmbeddedShortcodeHandler.php | 7 +++---- tests/Fixtures/Controller/ShortcodeTestController.php | 2 +- tests/Functional/EmbeddedShortcodeHandlerTest.php | 2 +- tests/Functional/EndToEndTest.php | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/fix-cs-php.yml b/.github/workflows/fix-cs-php.yml index 135f976..63617bf 100644 --- a/.github/workflows/fix-cs-php.yml +++ b/.github/workflows/fix-cs-php.yml @@ -21,7 +21,7 @@ jobs: ref: ${{ github.head_ref }} - name: Run PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga:3.11.0 + uses: docker://ghcr.io/webfactory/php-cs-fixer:3.62.0 - name: Commit and push back changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/src/Controller/GuideController.php b/src/Controller/GuideController.php index e6aa6ea..690ba21 100644 --- a/src/Controller/GuideController.php +++ b/src/Controller/GuideController.php @@ -42,7 +42,7 @@ final class GuideController /** * @param Twig_Environment|Environment $twig */ - public function __construct(array $shortcodeTags, $twig, FormFactoryInterface $formFactory = null) + public function __construct(array $shortcodeTags, $twig, ?FormFactoryInterface $formFactory = null) { $this->shortcodeTags = array_combine(array_map(function (array $definition): string { return $definition['shortcode']; }, $shortcodeTags), $shortcodeTags); $this->twig = $twig; diff --git a/src/Handler/EmbeddedShortcodeHandler.php b/src/Handler/EmbeddedShortcodeHandler.php index 36fc1ee..8dec477 100644 --- a/src/Handler/EmbeddedShortcodeHandler.php +++ b/src/Handler/EmbeddedShortcodeHandler.php @@ -34,16 +34,15 @@ class EmbeddedShortcodeHandler private $requestStack; /** - * @param string $controllerName - * @param string $renderer - * @param LoggerInterface $logger + * @param string $controllerName + * @param string $renderer */ public function __construct( FragmentHandler $fragmentHandler, $controllerName, $renderer, RequestStack $requestStack, - LoggerInterface $logger = null + ?LoggerInterface $logger = null ) { $this->fragmentHandler = $fragmentHandler; $this->controllerName = $controllerName; diff --git a/tests/Fixtures/Controller/ShortcodeTestController.php b/tests/Fixtures/Controller/ShortcodeTestController.php index 28f6d72..1b13ff4 100644 --- a/tests/Fixtures/Controller/ShortcodeTestController.php +++ b/tests/Fixtures/Controller/ShortcodeTestController.php @@ -6,7 +6,7 @@ class ShortcodeTestController { - public function test(string $foo = null): Response + public function test(?string $foo = null): Response { return new Response('test'.($foo ? ' foo='.$foo : '')); } diff --git a/tests/Functional/EmbeddedShortcodeHandlerTest.php b/tests/Functional/EmbeddedShortcodeHandlerTest.php index 721b610..9f817af 100644 --- a/tests/Functional/EmbeddedShortcodeHandlerTest.php +++ b/tests/Functional/EmbeddedShortcodeHandlerTest.php @@ -64,7 +64,7 @@ public function provideEsiShortcodes(): Generator yield 'ESI-based shortcode defined in service configuration' => ['test-service-esi']; } - private function processShortcodes(string $content, Request $request = null): string + private function processShortcodes(string $content, ?Request $request = null): string { self::bootKernel(); diff --git a/tests/Functional/EndToEndTest.php b/tests/Functional/EndToEndTest.php index 60a8cbf..9ebe992 100644 --- a/tests/Functional/EndToEndTest.php +++ b/tests/Functional/EndToEndTest.php @@ -72,7 +72,7 @@ public function provideEsiShortcodes(): Generator yield 'ESI-based shortcode defined in service configuration' => ['test-service-esi']; } - private function renderTwig(string $templateCode, array $context = [], Request $request = null): string + private function renderTwig(string $templateCode, array $context = [], ?Request $request = null): string { self::bootKernel(); $container = static::getContainer();