78283[TASK] Harden array callbacks in EXT:backend
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Stefan Froemken +1
- Benni Mack +1
-
Verified V +2 Done
- Stefan Bürk +2
- Stefan Froemken +1
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 49
- typo3/sysext/backend/Classes/Backend/ToolbarItems/UserToolbarItem.php6+1 −3
- typo3/sysext/backend/Classes/Command/CreateBackendUserCommand.php2+1 −1
- typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php4+1 −1
- typo3/sysext/backend/Classes/Controller/FileStorage/TreeController.php+3 −3
- typo3/sysext/backend/Classes/Controller/Page/TreeController.php+7 −7
- typo3/sysext/backend/Classes/Controller/PageTsConfig/PageTsConfigActiveController.php+2 −2
- typo3/sysext/backend/Classes/Controller/PageTsConfig/PageTsConfigIncludesController.php+2 −2
- typo3/sysext/backend/Classes/Controller/Wizard/AddController.php5+1 −1
- typo3/sysext/backend/Classes/Controller/AbstractMfaController.php+1 −1
- typo3/sysext/backend/Classes/Controller/BackendController.php+2 −2
- typo3/sysext/backend/Classes/Controller/EditDocumentController.php+1 −1
- typo3/sysext/backend/Classes/Controller/LiveSearchController.php6+2 −1
- typo3/sysext/backend/Classes/Controller/MfaAjaxController.php+1 −1
- typo3/sysext/backend/Classes/Controller/MfaController.php+1 −1
- typo3/sysext/backend/Classes/Controller/MfaSetupController.php+1 −1
- typo3/sysext/backend/Classes/Controller/NewRecordController.php+1 −1
- typo3/sysext/backend/Classes/Controller/RecordListController.php+2 −2
- typo3/sysext/backend/Classes/Form/Behavior/OnFieldChangeTrait.php+1 −1
- typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php+1 −1
- typo3/sysext/backend/Classes/Form/Container/SiteLanguageContainer.php+1 −1
Show 29 more files
- typo3/sysext/backend/Classes/Form/Element/CategoryElement.php+1 −1
- typo3/sysext/backend/Classes/Form/Element/EmailElement.php+1 −1
- typo3/sysext/backend/Classes/Form/Element/ImageManipulationElement.php+1 −1
- typo3/sysext/backend/Classes/Form/Element/LinkElement.php+2 −2
- typo3/sysext/backend/Classes/Form/Element/MfaInfoElement.php+1 −1
- typo3/sysext/backend/Classes/Form/Element/SelectSingleElement.php+1 −1
- typo3/sysext/backend/Classes/Form/Event/ModifyFileReferenceEnabledControlsEvent.php+1 −1
- typo3/sysext/backend/Classes/Form/Event/ModifyInlineElementEnabledControlsEvent.php+1 −1
- typo3/sysext/backend/Classes/Form/FieldInformation/AdminIsSystemMaintainer.php+1 −1
- typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php+7 −7
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaCategory.php+1 −1
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaFiles.php+1 −1
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaLanguage.php+1 −1
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php+3 −3
- typo3/sysext/backend/Classes/Form/Wizard/SuggestWizardDefaultReceiver.php+1 −1
- typo3/sysext/backend/Classes/LoginProvider/LoginProviderResolver.php+2 −2
- typo3/sysext/backend/Classes/Module/ModuleProvider.php+4 −4
- typo3/sysext/backend/Classes/Module/ModuleRegistry.php+2 −2
- typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php+6 −5
- typo3/sysext/backend/Classes/Routing/Route.php+1 −1
- typo3/sysext/backend/Classes/Search/LiveSearch/DatabaseRecordProvider.php+2 −2
- typo3/sysext/backend/Classes/Search/LiveSearch/PageRecordProvider.php+1 −1
- typo3/sysext/backend/Classes/Search/LiveSearch/SearchRepository.php+1 −1
- typo3/sysext/backend/Classes/Security/ContentSecurityPolicy/CspAjaxController.php+2 −2
- typo3/sysext/backend/Classes/Template/Components/Buttons/DropDownButton.php+1 −1
- typo3/sysext/backend/Classes/Tree/FileStorageTreeProvider.php+4 −4
- typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php+1 −1
- typo3/sysext/backend/Tests/Functional/RecordList/DownloadRecordListTest.php+1 −1
- typo3/sysext/backend/Tests/Functional/Tree/Repository/Fixtures/Tree/NormalizeTreeTrait.php+2 −2
Review log 3547
Show 1622 earlier messages
-
Oliver Klee uploaded patch set 1 03/27/23, 21:56
-
core-ci voted on patch set 1 V +1 03/27/23, 23:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39736
-
Stefan Bürk commented on patch set 1 03/29/23, 10:16
TBH only first quick scroll through with minor comments. No real/honest review yet.UserToolbarItem.php:101Why should this ever be `false` ?NewContentElementController.php:351If we typehint string|int, should we not add a (string)cast ?AddController.php:141ist das sicher ? kann das nicht auch eventuall `array|int|string` sein ? -
Andreas Kienast commented on patch set 1 03/29/23, 10:43
UserToolbarItem.php:101Reply`array|int` would be correct due to `array_flip()` in line 94. -
Stefan Bürk commented on patch set 1 03/29/23, 11:14
UserToolbarItem.php:101ReplyGot me, ack. -
Stefan Bürk commented on patch set 1 03/29/23, 11:15
AddController.php:141ReplyWhat the hack .. sorry for german. Is this safe, could this not be eventually `array|int|string` -
Oliver Klee commented on patch set 1 03/29/23, 11:18
UserToolbarItem.php:101ReplyDone.NewContentElementController.php:351ReplyNo, we don't need to. Having an int in a string concatenation implicitly casts the int to a string, and IIRC PHPStan would rightfully complain about the unnecessary cast.AddController.php:141ReplyBetter be safe - I've added `|string` now. Done. -
Oliver Klee uploaded patch set 2
V +103/29/23, 11:18 -
Andreas Kienast commented on patch set 1 03/29/23, 11:22
NewContentElementController.php:351ReplyNot necessarily. A dot is appended to whatever comes in, triggering an implicit string cast again.LiveSearchController.php:86Do we need the bool cast? `->getSearchProviderState()` already declares the returned array shape, so phpstan wise it should be safe.AddController.php:141ReplyYep, string is IMO missing. GeneralUtility::trimExplode() is explicitly annotated to return a list of strings. -
Oliver Klee commented on patch set 2 03/29/23, 11:24
NewContentElementController.php:351ReplyAck -
Oliver Klee commented on patch set 2 03/29/23, 11:26
LiveSearchController.php:86ReplyDoneAddController.php:141ReplyDone -
Oliver Klee uploaded patch set 3 03/29/23, 11:26
-
core-ci voted on patch set 2 V +1 03/29/23, 11:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39818
-
core-ci voted on patch set 3 V +1 03/29/23, 11:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39819
-
Oliver Klee uploaded patch set 4
V +104/13/23, 08:02 -
core-ci voted on patch set 4 V +1 04/13/23, 08:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40550
-
Oliver Klee rebased onto patch set 5
V +104/20/23, 15:10 -
core-ci voted on patch set 5 V +1 04/20/23, 15:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/40987
-
Oliver Klee rebased onto patch set 6
V +104/24/23, 11:17 -
core-ci voted on patch set 6 V +1 04/24/23, 11:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41148
-
Benni Mack commented on patch set 6 04/24/23, 12:24
UserToolbarItem.php:101could we use array_filter($mostRecentUsers, is_array(...)) instead?CreateBackendUserCommand.php:149we could simplify this by using fetchFirstColumn() ? -
Oliver Klee commented on patch set 6 04/24/23, 12:47
UserToolbarItem.php:101ReplyDoneCreateBackendUserCommand.php:149ReplyGood idea! I'd like to fix this in a separate change as it's out of scope for this change (adding type annotations to callables and use first-class callables). I've created the ticket https://forge.typo3.org/issues/100729 for this and assigned it to me.
-
Oliver Klee rebased onto patch set 7
V +104/24/23, 12:48 -
core-ci voted on patch set 7 V +1 04/24/23, 12:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41161
-
Benni Mack voted on patch set 7 CR +1 04/24/23, 12:56
-
Oliver Klee uploaded patch set 8
CR +1V +104/25/23, 12:12 -
core-ci voted on patch set 8 V +1 04/25/23, 12:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41215
-
Jörg Bösche voted on patch set 8 CR +1 04/28/23, 09:12
-
Oliver Klee rebased onto patch set 9
CR +1V +105/05/23, 13:46 -
core-ci voted on patch set 9 V +1 05/05/23, 13:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41609
-
Stefan Froemken commented on patch set 9 CR -1 05/10/23, 21:43
LiveSearchController.php:86IMO isActive is 0 or 1. So return value bool will fail. -
Oliver Klee commented on patch set 9 05/11/23, 07:50
LiveSearchController.php:86ReplyDone -
Oliver Klee uploaded patch set 10
CR -1V +105/11/23, 07:50 -
core-ci voted on patch set 10 V +1 05/11/23, 07:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41753
-
Andreas Kienast commented on patch set 10 CR -1 05/11/23, 08:01
LiveSearchController.php:86ReplyThat's not true. `isActive` is the result of `in_array()`, which returns a bool: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Search/LiveSearch/SearchRepository.php#L52 -
Oliver Klee commented on patch set 10 05/11/23, 08:04
LiveSearchController.php:86ReplyDone - I've removed the bool cast and added an explanatory comment for the next person who reads this line. -
Oliver Klee uploaded patch set 11
CR -1V +105/11/23, 08:04 -
core-ci voted on patch set 11 V +1 05/11/23, 08:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41754
-
Stefan Froemken voted on patch set 11 V +1 CR +1 05/11/23, 09:00
-
Benni Mack commented on patch set 11 07/04/23, 07:42
Can you resolve the merge conflict please? -
Oliver Klee commented on patch set 11 07/04/23, 08:37
Reply
Done. -
Oliver Klee uploaded patch set 12
CR +1V +107/04/23, 08:37 -
core-ci voted on patch set 12 V +1 07/04/23, 08:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43342
-
Benni Mack voted on patch set 12 V +1 CR +1 07/04/23, 13:11
-
Stefan Froemken voted on patch set 12 V +1 CR +1 07/05/23, 06:36
-
Stefan Bürk voted on patch set 12 V +2 CR +2 07/05/23, 08:05
-
Stefan Bürk merged patch set 13 07/05/23, 08:05