Review main Merged

78097[TASK] Modernize array function callbacks in GeneralUtility

Oliver Klee CR +2 V +2 Easy +7 −7 updated 03/14/23, 16:44

Commit message

Function callbacks are declared using the new PHP 8.1 feature
"first class callable", which e.g. uses the named `trim(...)`
function symbol, instead of the string `'trim'`.

see https://www.php.net/manual/en/functions.first_class_callable_syntax.php

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

  1. Oliver Klee uploaded patch set 1 03/12/23, 10:12

  2. 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

  3. 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?
  4. 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(...), ..`.
  5. Oliver Hader voted on patch set 1 CR +1 03/14/23, 10:41

  6. Oliver Hader updated the commit message in patch set 2 CR +1 V +1 03/14/23, 10:47

  7. Oliver Hader voted on patch set 2 CR +1 03/14/23, 10:47

  8. 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

  9. Oliver Klee commented on patch set 2 03/14/23, 11:06

    Thanks for the commit message improvement, Olli!
  10. Oliver Hader voted on patch set 2 V +1 03/14/23, 13:07

  11. Oliver Klee uploaded patch set 3 CR +1 V +1 03/14/23, 14:14

  12. Oliver Klee commented on patch set 3 03/14/23, 14:15

    Rebased and resolved the merge conflict.
  13. 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

  14. Benni Mack voted on patch set 3 CR +1 03/14/23, 15:26

  15. Christian Kuhn voted on patch set 3 V +1 CR +1 03/14/23, 16:19

  16. Oli Bartsch voted on patch set 3 V +1 CR +1 03/14/23, 16:21

  17. Christian Kuhn voted on patch set 3 V +2 CR +2 03/14/23, 16:21

  18. Christian Kuhn merged patch set 4 03/14/23, 16:21

  19. Oliver Hader voted on patch set 4 V +1 CR +1 03/14/23, 16:44