diff --git a/Build/php-cs-fixer.php b/Build/php-cs-fixer.php index 6ee0307..16494b6 100644 --- a/Build/php-cs-fixer.php +++ b/Build/php-cs-fixer.php @@ -2,4 +2,10 @@ $config = \TYPO3\CodingStandards\CsFixerConfig::create(); $config->getFinder()->exclude(['var'])->in(__DIR__ . '/..'); +$config->addRules([ + 'nullable_type_declaration' => [ + 'syntax' => 'question_mark', + ], + 'nullable_type_declaration_for_default_null_value' => true, +]); return $config; diff --git a/Classes/DataProcessing/ListItemsDataProcessor.php b/Classes/DataProcessing/ListItemsDataProcessor.php index 5f0b557..c5be5b8 100644 --- a/Classes/DataProcessing/ListItemsDataProcessor.php +++ b/Classes/DataProcessing/ListItemsDataProcessor.php @@ -22,9 +22,7 @@ #[Autoconfigure(public: true)] class ListItemsDataProcessor implements DataProcessorInterface { - public function __construct(protected ListService $listService, protected ContentDataProcessor $contentDataProcessor) - { - } + public function __construct(protected ListService $listService, protected ContentDataProcessor $contentDataProcessor) {} public function process( ContentObjectRenderer $cObj, diff --git a/Classes/Listener/PageContentPreviewRendering.php b/Classes/Listener/PageContentPreviewRendering.php index 6ba8321..dcd1f63 100644 --- a/Classes/Listener/PageContentPreviewRendering.php +++ b/Classes/Listener/PageContentPreviewRendering.php @@ -20,9 +20,7 @@ #[AsEventListener(identifier: 'b13-listelements-page-content-preview-rendering')] class PageContentPreviewRendering { - public function __construct(protected ListService $listService) - { - } + public function __construct(protected ListService $listService) {} public function __invoke(PageContentPreviewRenderingEvent $event): void { diff --git a/Classes/Service/ListService.php b/Classes/Service/ListService.php index 6eae46f..ba34940 100644 --- a/Classes/Service/ListService.php +++ b/Classes/Service/ListService.php @@ -111,7 +111,7 @@ public function resolveItemsForFrontend(int $uid, string $table = 'tt_content', if (isset($results[$uid])) { $item = $results[$uid]; $pageRepository->versionOL(self::TABLE, $item, true); - if ($item !== false) { + if (isset($item['uid'])) { $items[] = $item; } } diff --git a/composer.json b/composer.json index 0464fa6..814c135 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ "typo3/testing-framework": "^9.1", "typo3/cms-frontend": "^13.4 || ^14.1", "typo3/cms-workspaces": "^13.4 || ^14.1", - "phpstan/phpstan": "^1.10", - "typo3/coding-standards": "^0.5.5", + "phpstan/phpstan": "^2.1", + "typo3/coding-standards": "^0.8", "b13/listelements-example": "*" }, "autoload-dev": {