Skip to content

Commit

Permalink
[TASK] Run cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
MFabse committed Apr 3, 2024
1 parent 030ff9e commit 3fb9e4b
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/RegionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class RegionRepository
{
const APPLY_WHEN_NO_IP_MATCHES = -1;
public const APPLY_WHEN_NO_IP_MATCHES = -1;

/**
* @throws Exception
Expand Down
4 changes: 1 addition & 3 deletions Classes/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@

namespace Leuchtfeuer\Locate;

class Exception extends \Exception
{
}
class Exception extends \Exception {}
4 changes: 1 addition & 3 deletions Classes/Exception/IllegalActionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

namespace Leuchtfeuer\Locate\Exception;

class IllegalActionException extends \Exception
{
}
class IllegalActionException extends \Exception {}
4 changes: 1 addition & 3 deletions Classes/Exception/IllegalFactProviderException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

namespace Leuchtfeuer\Locate\Exception;

class IllegalFactProviderException extends \Exception
{
}
class IllegalFactProviderException extends \Exception {}
4 changes: 1 addition & 3 deletions Classes/Exception/IllegalJudgeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

namespace Leuchtfeuer\Locate\Exception;

class IllegalJudgeException extends \Exception
{
}
class IllegalJudgeException extends \Exception {}
4 changes: 1 addition & 3 deletions Classes/Exception/InvalidActionName.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

namespace Leuchtfeuer\Locate\Exception;

class InvalidActionName extends \Exception
{
}
class InvalidActionName extends \Exception {}
2 changes: 1 addition & 1 deletion Classes/FactProvider/BrowserAcceptedLanguage.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class BrowserAcceptedLanguage extends AbstractFactProvider
{
const PROVIDER_NAME = 'browseracceptlanguage';
public const PROVIDER_NAME = 'browseracceptlanguage';

protected bool $multiple = true;

Expand Down
4 changes: 2 additions & 2 deletions Classes/FactProvider/IP2Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class IP2Country extends AbstractFactProvider
{
const PROVIDER_NAME = 'countrybyip';
public const PROVIDER_NAME = 'countrybyip';

/**
* @inheritDoc
Expand All @@ -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 = '';
Expand Down
2 changes: 1 addition & 1 deletion Classes/FactProvider/StaticFactProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class StaticFactProvider extends AbstractFactProvider
{
const PROVIDER_NAME = 'static';
public const PROVIDER_NAME = 'static';

public function getBasename(): string
{
Expand Down
2 changes: 1 addition & 1 deletion Classes/Judge/AbstractJudge.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

abstract class AbstractJudge
{
const DEFAULT_PRIORITY = 999;
public const DEFAULT_PRIORITY = 999;

protected array $configuration = [];

Expand Down
8 changes: 3 additions & 5 deletions Classes/Middleware/LanguageRedirectMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,23 @@
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
{
if (!$this->isErrorPage($request)) {
$typoScript = $this->backendConfigurationManager->getTypoScriptSetup();

if (isset($typoScript['config.']['tx_locate']) && (int)$typoScript['config.']['tx_locate'] === 1) {

$locateSetup = $typoScript['config.']['tx_locate.'];

$config = [
Expand Down Expand Up @@ -93,4 +91,4 @@ private function getErrorPageUids(array $errorHandlers): array

return $errorPageUids;
}
}
}
2 changes: 1 addition & 1 deletion Classes/Store/SessionStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class SessionStore
{
const SESSION_BASE_NAME = 'tx_locate_';
public const SESSION_BASE_NAME = 'tx_locate_';

protected string $sessionBaseName;

Expand Down
4 changes: 2 additions & 2 deletions Classes/Verdict/Redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3fb9e4b

Please sign in to comment.