From f101341bc4f03b6e94bde80b29060b31c48c705d Mon Sep 17 00:00:00 2001 From: bocharsky-bw Date: Thu, 11 Apr 2024 13:01:52 +0200 Subject: [PATCH] Apply PHP CS Fixer changes --- Command/CheckMissingCommand.php | 2 +- Controller/SymfonyProfilerController.php | 2 +- Controller/WebUIController.php | 2 +- EditInPlace/Activator.php | 2 +- EditInPlace/ActivatorInterface.php | 2 +- EventListener/AutoAddMissingTranslations.php | 2 +- Service/CacheClearer.php | 2 +- Tests/Unit/Translator/EditInPlaceTranslatorTest.php | 2 +- Twig/TranslationExtension.php | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Command/CheckMissingCommand.php b/Command/CheckMissingCommand.php index be95e47e..e4b7faae 100644 --- a/Command/CheckMissingCommand.php +++ b/Command/CheckMissingCommand.php @@ -136,7 +136,7 @@ private function countEmptyTranslations(MessageCatalogueInterface $catalogue): i foreach ($catalogue->getDomains() as $domain) { $emptyTranslations = array_filter( $catalogue->all($domain), - function (string $message = null): bool { + function (?string $message = null): bool { return null === $message || '' === $message; } ); diff --git a/Controller/SymfonyProfilerController.php b/Controller/SymfonyProfilerController.php index b17f8502..8461ed7e 100644 --- a/Controller/SymfonyProfilerController.php +++ b/Controller/SymfonyProfilerController.php @@ -95,7 +95,7 @@ public function syncAction(Request $request, string $token): Response } /** - * @return \Symfony\Component\HttpFoundation\RedirectResponse|Response + * @return RedirectResponse|Response */ public function syncAllAction(Request $request, string $token): Response { diff --git a/Controller/WebUIController.php b/Controller/WebUIController.php index 0604ba29..2ce6de07 100644 --- a/Controller/WebUIController.php +++ b/Controller/WebUIController.php @@ -76,7 +76,7 @@ public function __construct( /** * Show a dashboard for the configuration. */ - public function indexAction(string $configName = null): Response + public function indexAction(?string $configName = null): Response { if (!$this->isWebUIEnabled) { return new Response('You are not allowed here. Check your config.', Response::HTTP_BAD_REQUEST); diff --git a/EditInPlace/Activator.php b/EditInPlace/Activator.php index b5c38583..b327521e 100644 --- a/EditInPlace/Activator.php +++ b/EditInPlace/Activator.php @@ -81,7 +81,7 @@ public function deactivate(): void } } - public function checkRequest(Request $request = null): bool + public function checkRequest(?Request $request = null): bool { if (null === $this->getSession() || !$this->getSession()->has(self::KEY)) { return false; diff --git a/EditInPlace/ActivatorInterface.php b/EditInPlace/ActivatorInterface.php index 13c761fa..7100abd5 100644 --- a/EditInPlace/ActivatorInterface.php +++ b/EditInPlace/ActivatorInterface.php @@ -21,5 +21,5 @@ interface ActivatorInterface /** * Tells if the Edit In Place mode is enabled for this request. */ - public function checkRequest(Request $request = null): bool; + public function checkRequest(?Request $request = null): bool; } diff --git a/EventListener/AutoAddMissingTranslations.php b/EventListener/AutoAddMissingTranslations.php index 844888e5..195bf478 100644 --- a/EventListener/AutoAddMissingTranslations.php +++ b/EventListener/AutoAddMissingTranslations.php @@ -31,7 +31,7 @@ final class AutoAddMissingTranslations */ private $storage; - public function __construct(StorageService $storage, DataCollectorTranslator $translator = null) + public function __construct(StorageService $storage, ?DataCollectorTranslator $translator = null) { $this->dataCollector = $translator; $this->storage = $storage; diff --git a/Service/CacheClearer.php b/Service/CacheClearer.php index 6273a844..869ad637 100644 --- a/Service/CacheClearer.php +++ b/Service/CacheClearer.php @@ -58,7 +58,7 @@ public function __construct(string $kernelCacheDir, $translator, Filesystem $fil * * @param string|null $locale optional filter to clear only one locale */ - public function clearAndWarmUp(string $locale = null): void + public function clearAndWarmUp(?string $locale = null): void { $translationDir = sprintf('%s/translations', $this->kernelCacheDir); diff --git a/Tests/Unit/Translator/EditInPlaceTranslatorTest.php b/Tests/Unit/Translator/EditInPlaceTranslatorTest.php index 80e04004..04122189 100644 --- a/Tests/Unit/Translator/EditInPlaceTranslatorTest.php +++ b/Tests/Unit/Translator/EditInPlaceTranslatorTest.php @@ -113,7 +113,7 @@ public function __construct(bool $enabled = true) $this->enabled = $enabled; } - public function checkRequest(Request $request = null): bool + public function checkRequest(?Request $request = null): bool { return $this->enabled; } diff --git a/Twig/TranslationExtension.php b/Twig/TranslationExtension.php index b97b0f05..ba065e29 100644 --- a/Twig/TranslationExtension.php +++ b/Twig/TranslationExtension.php @@ -71,7 +71,7 @@ public function getNodeVisitors(): array return $visitors; } - public function transchoiceWithDefault(string $message, string $defaultMessage, int $count, array $arguments = [], string $domain = null, string $locale = null): string + public function transchoiceWithDefault(string $message, string $defaultMessage, int $count, array $arguments = [], ?string $domain = null, ?string $locale = null): string { if (null === $domain) { $domain = 'messages';