Skip to content

Commit df42c55

Browse files
authored
Merge pull request #41 from b13/coding-guidelines
[TASK] Update coding-guidelines
2 parents 2ae0494 + 397e598 commit df42c55

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

Build/php-cs-fixer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22

33
$config = \TYPO3\CodingStandards\CsFixerConfig::create();
44
$config->getFinder()->exclude(['var'])->in(__DIR__ . '/..');
5+
$config->addRules([
6+
'nullable_type_declaration' => [
7+
'syntax' => 'question_mark',
8+
],
9+
'nullable_type_declaration_for_default_null_value' => true,
10+
]);
511
return $config;

Classes/DataProcessing/ListItemsDataProcessor.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
#[Autoconfigure(public: true)]
2323
class ListItemsDataProcessor implements DataProcessorInterface
2424
{
25-
public function __construct(protected ListService $listService, protected ContentDataProcessor $contentDataProcessor)
26-
{
27-
}
25+
public function __construct(protected ListService $listService, protected ContentDataProcessor $contentDataProcessor) {}
2826

2927
public function process(
3028
ContentObjectRenderer $cObj,

Classes/Listener/PageContentPreviewRendering.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
#[AsEventListener(identifier: 'b13-listelements-page-content-preview-rendering')]
2121
class PageContentPreviewRendering
2222
{
23-
public function __construct(protected ListService $listService)
24-
{
25-
}
23+
public function __construct(protected ListService $listService) {}
2624

2725
public function __invoke(PageContentPreviewRenderingEvent $event): void
2826
{

Classes/Service/ListService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function resolveItemsForFrontend(int $uid, string $table = 'tt_content',
111111
if (isset($results[$uid])) {
112112
$item = $results[$uid];
113113
$pageRepository->versionOL(self::TABLE, $item, true);
114-
if ($item !== false) {
114+
if (isset($item['uid'])) {
115115
$items[] = $item;
116116
}
117117
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"typo3/testing-framework": "^9.1",
2424
"typo3/cms-frontend": "^13.4 || ^14.1",
2525
"typo3/cms-workspaces": "^13.4 || ^14.1",
26-
"phpstan/phpstan": "^1.10",
27-
"typo3/coding-standards": "^0.5.5",
26+
"phpstan/phpstan": "^2.1",
27+
"typo3/coding-standards": "^0.8",
2828
"b13/listelements-example": "*"
2929
},
3030
"autoload-dev": {

0 commit comments

Comments
 (0)