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();