78097[TASK] Modernize array function callbacks in GeneralUtility
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Oli Bartsch +1
- Oliver Hader +1
- Benni Mack +1
-
Verified V +2 Done
- Christian Kuhn +2
- Oli Bartsch +1
- Oliver Hader +1
- core-ci +1 CI
Issues 1
Files 1
Review log 1720
-
Oliver Klee uploaded patch set 1 03/12/23, 10:12
-
core-ci voted on patch set 1 V +1 03/12/23, 10:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38824
-
Oliver Hader commented on patch set 1 03/13/23, 22:40
Is there already a fixer rule in php-cs-fixer to enforce the first class callable syntax? -
Oliver Klee commented on patch set 1 03/14/23, 09:54
Reply
There are three related rules which might be helpful: - https://cs.symfony.com/doc/rules/function_notation/regular_callable_call.html - https://cs.symfony.com/doc/rules/function_notation/use_arrow_functions.html - https://cs.symfony.com/doc/rules/function_notation/lambda_not_used_import.html I'll try them out in a separate change: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78117 -
Oliver Hader commented on patch set 1 03/14/23, 10:41
Reply
Nice! I'd be careful with `return function () {}` calls, which might receive a later binding to a different `$newThis` - which is unlikely, but should be checked. It does not look like there are fixers for first class callable symbols, e.g. https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/Form/Container/SiteLanguageContainer.php#L128 is not converted to `array_map(strval(...), ..`. -
Oliver Hader voted on patch set 1 CR +1 03/14/23, 10:41
-
Oliver Hader updated the commit message in patch set 2
CR +1V +103/14/23, 10:47 -
Oliver Hader voted on patch set 2 CR +1 03/14/23, 10:47
-
core-ci voted on patch set 2 V +1 03/14/23, 10:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38911
-
Oliver Klee commented on patch set 2 03/14/23, 11:06
Thanks for the commit message improvement, Olli! -
Oliver Hader voted on patch set 2 V +1 03/14/23, 13:07
-
Oliver Klee uploaded patch set 3
CR +1V +103/14/23, 14:14 -
Oliver Klee commented on patch set 3 03/14/23, 14:15
Rebased and resolved the merge conflict. -
core-ci voted on patch set 3 V +1 03/14/23, 14:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38930
-
Benni Mack voted on patch set 3 CR +1 03/14/23, 15:26
-
Christian Kuhn voted on patch set 3 V +1 CR +1 03/14/23, 16:19
-
Oli Bartsch voted on patch set 3 V +1 CR +1 03/14/23, 16:21
-
Christian Kuhn voted on patch set 3 V +2 CR +2 03/14/23, 16:21
-
Christian Kuhn merged patch set 4 03/14/23, 16:21
-
Oliver Hader voted on patch set 4 V +1 CR +1 03/14/23, 16:44