Skip to content

Commit

Permalink
[TASK] Set PHP level to 8.2 via Rector (#238)
Browse files Browse the repository at this point in the history
Releases: main
  • Loading branch information
brotkrueml authored Mar 6, 2024
1 parent e45bd0e commit abf2b1f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Classes/Controller/AdminModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
use TYPO3\CMS\Core\Localization\LanguageService;

#[Controller]
final class AdminModuleController
final readonly class AdminModuleController
{
public function __construct(
protected readonly ModuleTemplateFactory $moduleTemplateFactory,
protected readonly IconFactory $iconFactory,
protected ModuleTemplateFactory $moduleTemplateFactory,
protected IconFactory $iconFactory,
// ...
) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
#[AsEventListener(
identifier: 'txExampleCheckExternalLinksToLocalPages',
)]
final class CheckExternalLinksToLocalPagesEventListener
final readonly class CheckExternalLinksToLocalPagesEventListener
{
private const LOCAL_DOMAIN = 'example.org';
private const TABLE_NAME = 'tt_content';
private const FIELD_NAME = 'bodytext';

public function __construct(
private readonly BrokenLinkRepository $brokenLinkRepository,
private readonly SoftReferenceParserFactory $softReferenceParserFactory,
private BrokenLinkRepository $brokenLinkRepository,
private SoftReferenceParserFactory $softReferenceParserFactory,
) {}

public function __invoke(BeforeRecordIsAnalyzedEvent $event): void
Expand Down
4 changes: 2 additions & 2 deletions Classes/Http/MeowInformationRequester.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

use TYPO3\CMS\Core\Http\RequestFactory;

final class MeowInformationRequester
final readonly class MeowInformationRequester
{
private const API_URL = 'https://catfact.ninja/fact';

// We need the RequestFactory for creating and sending a request,
// so we inject it into the class using constructor injection.
public function __construct(
private readonly RequestFactory $requestFactory,
private RequestFactory $requestFactory,
) {}

/**
Expand Down
8 changes: 4 additions & 4 deletions Classes/Middleware/HaikuSeasonList.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
* "/de/haiku-season-list.json" for German translation (if /de is the configured base path)
* If the base path is not available in the according site the default language will be used.
*/
final class HaikuSeasonList implements MiddlewareInterface
final readonly class HaikuSeasonList implements MiddlewareInterface
{
private const SEASONS = ['spring', 'summer', 'autumn', 'winter', 'theFifthSeason'];
private const TRANSLATION_PATH = 'LLL:EXT:examples/Resources/Private/Language/PluginHaiku/locallang.xlf:season.';
private const URL_SEGMENT = '/haiku-season-list.json';

public function __construct(
private readonly LanguageServiceFactory $languageServiceFactory,
private readonly ResponseFactoryInterface $responseFactory,
private readonly StreamFactoryInterface $streamFactory,
private LanguageServiceFactory $languageServiceFactory,
private ResponseFactoryInterface $responseFactory,
private StreamFactoryInterface $streamFactory,
) {}

public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
]);

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
LevelSetList::UP_TO_PHP_82,
]);

$rectorConfig->skip([
Expand Down

0 comments on commit abf2b1f

Please sign in to comment.