Review main Merged

93621[TASK] Harmonize native function call style

Oliver Klee CR +2 V +2 Normal +55 −49 updated 04/11/26, 07:51

Commit message

So far, most of the calls to native PHP functions like `strlen`
did not have a leading backslash, while a few had.

Using a leading backslash very slightly improves performance
[1] while adding visual noise.

Harmonize this to never use a leading backslash in order to make
the code easier to read, and add a PHP-CS-Fixer rule [2] to enforce
that.

[1] https://veewee.github.io/blog/optimizing-php-performance-by-fq-function-calls/
[2] https://cs.symfony.com/doc/rules/function_notation/native_function_invocation.html

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 26

Show 6 more files

Review log 1115

  1. Oliver Klee uploaded patch set 1 04/11/26, 06:24

  2. Oliver Klee updated the commit message in patch set 2 04/11/26, 06:25

  3. core-ci voted on patch set 1 V +1 04/11/26, 06:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99951

  4. core-ci voted on patch set 2 V +1 04/11/26, 06:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99952

  5. Garvin Hicking commented on patch set 2 04/11/26, 06:58

    ```suggestion Using a leading backslash very slightly improves performance ```
  6. Garvin Hicking updated the commit message in patch set 3 V +1 04/11/26, 06:59

  7. Garvin Hicking commented on patch set 3 CR +1 V +1 04/11/26, 07:04

    Reply

    Fix applied.
  8. core-ci voted on patch set 3 V -1 04/11/26, 07:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99953

  9. Christian Kuhn commented on patch set 3 04/11/26, 07:25

    when i apply the patch, go to Avatar.php and add a backlash in front of an \sprintf() or \get_debug_type(), i'd expect runTests.sh -s phpstan to mumble on it. that's not the case. is my expectation incorrect?
  10. Garvin Hicking commented on patch set 3 04/11/26, 07:27

    Reply

    The affected config is cs-fixer, so pre-merge commit. Not phpstan. Haven't checked but I believe these style checks are also executed in CI?
  11. core-ci voted on patch set 3 V +1 04/11/26, 07:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99953

  12. Christian Kuhn commented on patch set 3 04/11/26, 07:47

    Reply

    lol. foo. sorry.
  13. Christian Kuhn commented on patch set 3 CR +1 V +1 04/11/26, 07:48

    Reply

    works. upvoted. thx!
  14. Christian Kuhn voted on patch set 3 CR +2 V +2 04/11/26, 07:51

  15. Christian Kuhn merged patch set 4 04/11/26, 07:51