Skip to content

Commit 5879f6e

Browse files
derhansenbmack
authored andcommitted
[TASK] Handle ext:styleguide phpstan baseline entries
This change handles 3 ext:styleguide related phpstan baseline entries by: * defining `readonly` related attribute values as string * removing superfluous `is_array` checks The `OnFieldChangeTrait` related baseline item for ext:styleguide remains, as this should be fixed globally in ext:backend. Resolves: #108378 Releases: main, 13.4 Signed-off-by: Torben Hansen <derhansen@gmail.com> Change-Id: I40f89f47d5990432b16a44aad4a5547da96be01c Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/91985 Tested-by: Benni Mack <benni@typo3.org> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Benni Mack <benni@typo3.org>
1 parent 8641d3c commit 5879f6e

File tree

4 files changed

+10
-37
lines changed

4 files changed

+10
-37
lines changed

Build/phpstan/phpstan-baseline.neon

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4284,24 +4284,6 @@ parameters:
42844284
count: 1
42854285
path: ../../typo3/sysext/styleguide/Classes/Form/Element/User1Element.php
42864286

4287-
-
4288-
message: '#^Call to function is_array\(\) with list\<array\<string, mixed\>\> will always evaluate to true\.$#'
4289-
identifier: function.alreadyNarrowedType
4290-
count: 4
4291-
path: ../../typo3/sysext/styleguide/Classes/TcaDataGenerator/RecordFinder.php
4292-
4293-
-
4294-
message: '#^Parameter \#1 \$arr of static method TYPO3\\CMS\\Core\\Utility\\GeneralUtility\:\:implodeAttributes\(\) expects array\<string, int\|string\>, array\<string, string\|true\> given\.$#'
4295-
identifier: argument.type
4296-
count: 1
4297-
path: ../../typo3/sysext/styleguide/Classes/ViewHelpers/CodeViewHelper.php
4298-
4299-
-
4300-
message: '#^Parameter \#1 \$arr of static method TYPO3\\CMS\\Core\\Utility\\GeneralUtility\:\:implodeAttributes\(\) expects array\<string, int\|string\>, array\<string, string\|true\> given\.$#'
4301-
identifier: argument.type
4302-
count: 1
4303-
path: ../../typo3/sysext/styleguide/Classes/ViewHelpers/ExampleViewHelper.php
4304-
43054287
-
43064288
message: '#^Instanceof between TYPO3\\CMS\\Core\\Site\\Entity\\Site and TYPO3\\CMS\\Core\\Site\\Entity\\Site will always evaluate to true\.$#'
43074289
identifier: instanceof.alwaysTrue

typo3/sysext/styleguide/Classes/TcaDataGenerator/RecordFinder.php

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,8 @@ public function findUidsOfDemoBeGroups(): array
164164
->executeQuery()
165165
->fetchAllAssociative();
166166
$result = [];
167-
if (is_array($rows)) {
168-
foreach ($rows as $row) {
169-
$result[] = $row['uid'];
170-
}
167+
foreach ($rows as $row) {
168+
$result[] = $row['uid'];
171169
}
172170
return $result;
173171
}
@@ -192,10 +190,8 @@ public function findUidsOfDemoBeUsers(): array
192190
->executeQuery()
193191
->fetchAllAssociative();
194192
$result = [];
195-
if (is_array($rows)) {
196-
foreach ($rows as $row) {
197-
$result[] = $row['uid'];
198-
}
193+
foreach ($rows as $row) {
194+
$result[] = $row['uid'];
199195
}
200196
return $result;
201197
}
@@ -221,10 +217,8 @@ public function findUidsOfStaticdata(): array
221217
->executeQuery()
222218
->fetchAllAssociative();
223219
$result = [];
224-
if (is_array($rows)) {
225-
foreach ($rows as $row) {
226-
$result[] = $row['uid'];
227-
}
220+
foreach ($rows as $row) {
221+
$result[] = $row['uid'];
228222
}
229223
return $result;
230224
}
@@ -296,11 +290,8 @@ public function findUidsOfFrontendPages(array $types = ['tx_styleguide_frontend_
296290
}
297291

298292
$rows = $queryBuilder->orderBy('pid', 'DESC')->executeQuery()->fetchAllAssociative();
299-
$result = [];
300-
if (is_array($rows)) {
301-
$result = array_column($rows, 'uid');
302-
sort($result);
303-
}
293+
$result = array_column($rows, 'uid');
294+
sort($result);
304295

305296
return $result;
306297
}

typo3/sysext/styleguide/Classes/ViewHelpers/CodeViewHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function render(): string
9191

9292
$codeMirrorConfig = [
9393
'mode' => GeneralUtility::jsonEncodeForHtmlAttribute($mode->getModule(), false),
94-
'readonly' => true,
94+
'readonly' => 'readonly',
9595
];
9696
$attributes = [
9797
'wrap' => 'off',

typo3/sysext/styleguide/Classes/ViewHelpers/ExampleViewHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function render(): string
101101

102102
$codeMirrorConfig = [
103103
'mode' => GeneralUtility::jsonEncodeForHtmlAttribute($mode->getModule(), false),
104-
'readonly' => true,
104+
'readonly' => 'readonly',
105105
];
106106
$attributes = [
107107
'wrap' => 'off',

0 commit comments

Comments
 (0)