From 3fb9e4b7ab227d414fb2a220fc7a25e08ab1ec8e Mon Sep 17 00:00:00 2001 From: Fabian Martin Date: Wed, 3 Apr 2024 08:55:28 +0200 Subject: [PATCH] [TASK] Run cs-fixer --- Classes/Domain/Repository/RegionRepository.php | 2 +- Classes/Exception.php | 4 +--- Classes/Exception/IllegalActionException.php | 4 +--- Classes/Exception/IllegalFactProviderException.php | 4 +--- Classes/Exception/IllegalJudgeException.php | 4 +--- Classes/Exception/InvalidActionName.php | 4 +--- Classes/FactProvider/BrowserAcceptedLanguage.php | 2 +- Classes/FactProvider/IP2Country.php | 4 ++-- Classes/FactProvider/StaticFactProvider.php | 2 +- Classes/Judge/AbstractJudge.php | 2 +- Classes/Middleware/LanguageRedirectMiddleware.php | 8 +++----- Classes/Store/SessionStore.php | 2 +- Classes/Verdict/Redirect.php | 4 ++-- 13 files changed, 17 insertions(+), 29 deletions(-) diff --git a/Classes/Domain/Repository/RegionRepository.php b/Classes/Domain/Repository/RegionRepository.php index 6a0814c..609b5b5 100644 --- a/Classes/Domain/Repository/RegionRepository.php +++ b/Classes/Domain/Repository/RegionRepository.php @@ -19,7 +19,7 @@ class RegionRepository { - const APPLY_WHEN_NO_IP_MATCHES = -1; + public const APPLY_WHEN_NO_IP_MATCHES = -1; /** * @throws Exception diff --git a/Classes/Exception.php b/Classes/Exception.php index b09ea45..e68620a 100644 --- a/Classes/Exception.php +++ b/Classes/Exception.php @@ -13,6 +13,4 @@ namespace Leuchtfeuer\Locate; -class Exception extends \Exception -{ -} +class Exception extends \Exception {} diff --git a/Classes/Exception/IllegalActionException.php b/Classes/Exception/IllegalActionException.php index 4af0406..19af168 100644 --- a/Classes/Exception/IllegalActionException.php +++ b/Classes/Exception/IllegalActionException.php @@ -11,6 +11,4 @@ namespace Leuchtfeuer\Locate\Exception; -class IllegalActionException extends \Exception -{ -} +class IllegalActionException extends \Exception {} diff --git a/Classes/Exception/IllegalFactProviderException.php b/Classes/Exception/IllegalFactProviderException.php index 253cc17..ac6f41f 100644 --- a/Classes/Exception/IllegalFactProviderException.php +++ b/Classes/Exception/IllegalFactProviderException.php @@ -11,6 +11,4 @@ namespace Leuchtfeuer\Locate\Exception; -class IllegalFactProviderException extends \Exception -{ -} +class IllegalFactProviderException extends \Exception {} diff --git a/Classes/Exception/IllegalJudgeException.php b/Classes/Exception/IllegalJudgeException.php index 5b43e72..172cf4a 100644 --- a/Classes/Exception/IllegalJudgeException.php +++ b/Classes/Exception/IllegalJudgeException.php @@ -11,6 +11,4 @@ namespace Leuchtfeuer\Locate\Exception; -class IllegalJudgeException extends \Exception -{ -} +class IllegalJudgeException extends \Exception {} diff --git a/Classes/Exception/InvalidActionName.php b/Classes/Exception/InvalidActionName.php index f6c53d5..0a619b7 100644 --- a/Classes/Exception/InvalidActionName.php +++ b/Classes/Exception/InvalidActionName.php @@ -11,6 +11,4 @@ namespace Leuchtfeuer\Locate\Exception; -class InvalidActionName extends \Exception -{ -} +class InvalidActionName extends \Exception {} diff --git a/Classes/FactProvider/BrowserAcceptedLanguage.php b/Classes/FactProvider/BrowserAcceptedLanguage.php index 916c8f5..acc1ac1 100644 --- a/Classes/FactProvider/BrowserAcceptedLanguage.php +++ b/Classes/FactProvider/BrowserAcceptedLanguage.php @@ -18,7 +18,7 @@ class BrowserAcceptedLanguage extends AbstractFactProvider { - const PROVIDER_NAME = 'browseracceptlanguage'; + public const PROVIDER_NAME = 'browseracceptlanguage'; protected bool $multiple = true; diff --git a/Classes/FactProvider/IP2Country.php b/Classes/FactProvider/IP2Country.php index 522aeb3..e4e4dee 100644 --- a/Classes/FactProvider/IP2Country.php +++ b/Classes/FactProvider/IP2Country.php @@ -18,7 +18,7 @@ class IP2Country extends AbstractFactProvider { - const PROVIDER_NAME = 'countrybyip'; + public const PROVIDER_NAME = 'countrybyip'; /** * @inheritDoc @@ -33,7 +33,7 @@ public function getBasename(): string */ public function process(): self { - $simulateIp = $this->configuration['settings']['simulateIp'] ? : null; + $simulateIp = $this->configuration['settings']['simulateIp'] ?: null; $iso2 = GeneralUtility::makeInstance(LocateUtility::class)->getCountryIso2FromIP($simulateIp); if ($iso2 === false) { $iso2 = ''; diff --git a/Classes/FactProvider/StaticFactProvider.php b/Classes/FactProvider/StaticFactProvider.php index 57362b8..a77c963 100644 --- a/Classes/FactProvider/StaticFactProvider.php +++ b/Classes/FactProvider/StaticFactProvider.php @@ -13,7 +13,7 @@ class StaticFactProvider extends AbstractFactProvider { - const PROVIDER_NAME = 'static'; + public const PROVIDER_NAME = 'static'; public function getBasename(): string { diff --git a/Classes/Judge/AbstractJudge.php b/Classes/Judge/AbstractJudge.php index 1c7b67f..fa20c90 100644 --- a/Classes/Judge/AbstractJudge.php +++ b/Classes/Judge/AbstractJudge.php @@ -17,7 +17,7 @@ abstract class AbstractJudge { - const DEFAULT_PRIORITY = 999; + public const DEFAULT_PRIORITY = 999; protected array $configuration = []; diff --git a/Classes/Middleware/LanguageRedirectMiddleware.php b/Classes/Middleware/LanguageRedirectMiddleware.php index 9f90254..9827e5d 100644 --- a/Classes/Middleware/LanguageRedirectMiddleware.php +++ b/Classes/Middleware/LanguageRedirectMiddleware.php @@ -19,17 +19,16 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; +use TYPO3\CMS\Core\LinkHandling\LinkService; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager; -use TYPO3\CMS\Core\LinkHandling\LinkService; final class LanguageRedirectMiddleware implements MiddlewareInterface { public function __construct( private readonly BackendConfigurationManager $backendConfigurationManager, private readonly LinkService $link - ) { - } + ) {} public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { @@ -37,7 +36,6 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface $typoScript = $this->backendConfigurationManager->getTypoScriptSetup(); if (isset($typoScript['config.']['tx_locate']) && (int)$typoScript['config.']['tx_locate'] === 1) { - $locateSetup = $typoScript['config.']['tx_locate.']; $config = [ @@ -93,4 +91,4 @@ private function getErrorPageUids(array $errorHandlers): array return $errorPageUids; } -} \ No newline at end of file +} diff --git a/Classes/Store/SessionStore.php b/Classes/Store/SessionStore.php index c553d0d..468cf55 100644 --- a/Classes/Store/SessionStore.php +++ b/Classes/Store/SessionStore.php @@ -13,7 +13,7 @@ class SessionStore { - const SESSION_BASE_NAME = 'tx_locate_'; + public const SESSION_BASE_NAME = 'tx_locate_'; protected string $sessionBaseName; diff --git a/Classes/Verdict/Redirect.php b/Classes/Verdict/Redirect.php index ae25c54..6d476fa 100644 --- a/Classes/Verdict/Redirect.php +++ b/Classes/Verdict/Redirect.php @@ -25,8 +25,8 @@ class Redirect extends AbstractVerdict { - const SESSION_KEY = 'language'; - const OVERRIDE_PARAMETER = 'setLang'; + public const SESSION_KEY = 'language'; + public const OVERRIDE_PARAMETER = 'setLang'; private bool $sessionMode = false;