Review main Merged

92355[TASK] Prevent disallowed named arguments usage using phpstan

Simon Schaufelberger CR +2 V +2 Hard +480 −137 updated 03/13/26, 11:41

Commit message

Core mergers decided on named arguments with document [1]:
"Within the TYPO3 Core, named arguments are not used when
invoking its own methods." The only exceptions are phpunit
test data providers and data object creation (using new())
with public property constructor promotion (where argument
names are API by design).

The patch adds a custom phpstan rule to enforce this and
adapts all (not test related) findings to establish a clean
baseline.

Note the unit tests for the phpstan rule are not part of
the casual unit test run. There are further tests within
Build/ not executed on a regular basis. This could be
sorted out with a dedicated patch if needed.

[1] https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/PhpArchitecture/NamedArguments.html

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 49

Show 29 more files

Review log 1928

Show 23 earlier messages
  1. Simon Schaufelberger uploaded patch set 1 01/16/26, 20:35

  2. Simon Schaufelberger marked it work in progress 01/16/26, 20:35

  3. core-ci voted on patch set 1 V -1 01/16/26, 20:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93631

  1. Simon Schaufelberger uploaded patch set 2 V -1 01/16/26, 20:59

  2. core-ci voted on patch set 2 V +1 01/16/26, 21:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93634

  3. Simon Schaufelberger uploaded patch set 3 V +1 03/10/26, 20:55

  4. core-ci voted on patch set 3 V -1 03/10/26, 21:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97721

  5. Christian Kuhn commented on patch set 3 03/10/26, 21:38

    it looks to me as if the violations i was aware of are caught by this change. as such, i'm of the opinion that we should get this one done.
  6. Simon Schaufelberger uploaded patch set 4 V -1 03/10/26, 22:58

  7. Simon Schaufelberger commented on patch set 4 03/10/26, 22:59

    This change is ready for review.
  8. Simon Schaufelberger commented on patch set 4 03/10/26, 23:07

    phpstan.neon:22

    the indentation is different here as the whole file is with spaces BUT in .editorconfig it is configured as: ``` [*.neon] indent_size = 2 indent_style = tab ```
  9. core-ci voted on patch set 4 V +1 03/10/26, 23:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97724

  10. Oliver Klee voted on patch set 4 V +1 03/11/26, 08:15

  11. Christian Kuhn uploaded patch set 5 V +1 03/13/26, 10:35

  12. Christian Kuhn commented on patch set 5 03/13/26, 10:36

    phpstan.neon:22 Reply

    let's ignore this if possible with this patch for now.
  13. Christian Kuhn uploaded patch set 6 03/13/26, 10:40

  14. Christian Kuhn updated the commit message in patch set 7 03/13/26, 10:41

  15. Christian Kuhn updated the commit message in patch set 8 03/13/26, 10:48

  16. Christian Kuhn uploaded patch set 9 03/13/26, 10:49

  17. core-ci voted on patch set 5 V -1 03/13/26, 10:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97878

  18. core-ci voted on patch set 9 V +1 03/13/26, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97883

  19. Christian Kuhn voted on patch set 9 CR +1 V +1 03/13/26, 11:09

  20. core-ci voted on patch set 6 V -1 03/13/26, 11:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97879

  21. core-ci voted on patch set 7 V -1 03/13/26, 11:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97880

  22. Stefan Bürk voted on patch set 9 CR +1 V +1 03/13/26, 11:27

  23. core-ci voted on patch set 8 V -1 03/13/26, 11:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97882

  24. Christian Kuhn voted on patch set 9 CR +2 V +2 03/13/26, 11:41

  25. Christian Kuhn merged patch set 10 03/13/26, 11:41