From df47cd552906f196ad4d964fccc322224fd38e8f Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Mon, 26 Aug 2024 11:00:24 +0200 Subject: [PATCH 1/2] Aktualisiere PHP-CS-Fixer auf v3.62.0 (Batch-commit via https://github.com/webfactory/bfg9000/pull/8, Case 174703) --- .github/workflows/fix-cs-php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 2d34c23631ed329abd5a315621c83902d9bf734e Mon Sep 17 00:00:00 2001 From: mpdude Date: Mon, 26 Aug 2024 09:00:42 +0000 Subject: [PATCH 2/2] Fix CS with PHP-CS-Fixer --- 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 +- 5 files changed, 7 insertions(+), 8 deletions(-) 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();