Review main Merged

74535[BUGFIX] Correct type annotation of GU::callUserFunction()

Andreas Kienast CR +2 V +2 Easy +3 −17 updated 05/07/22, 12:30

Commit message

The argument `$funcName` is now annotated as `non-empty-string|\Closure`
to reflect the actual allowed input types. Additionally corresponding
test in `GeneralUtilityTest.php` is also annotated properly.

Used command:

> Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Oliver Klee +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1822

  1. Andreas Kienast uploaded patch set 1 05/06/22, 14:12

  2. Oliver Klee commented on patch set 1 05/06/22, 14:15

    GeneralUtility.php:2828

    I think we can be even more specific for both types: non-empty-string|\Closure
  3. Oliver Klee commented on patch set 1 05/06/22, 14:17

    GeneralUtility.php:2828 Reply

    (We then probably need to re-run the baseline generation as PHPStan might catch some cases where the caller does not have the necessary type annotations/declarations yet, which we should fix later in separate changes.)
  4. core-ci voted on patch set 1 V +1 05/06/22, 14:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26920

  5. Andreas Kienast commented on patch set 1 05/06/22, 14:30

    GeneralUtility.php:2828 Reply

    I'm not sure about this, we have an explicit test case for this.
  6. Andreas Kienast uploaded patch set 2 05/06/22, 14:54

  7. Oliver Klee commented on patch set 2 05/06/22, 14:58

    GeneralUtility.php:2828 Reply

    Done
  8. Oliver Klee voted on patch set 2 CR +1 05/06/22, 14:58

  9. core-ci voted on patch set 2 V +1 05/06/22, 15:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26924

  10. Oliver Klee voted on patch set 2 V +1 05/06/22, 15:23

  11. Stefan Bürk commented on patch set 2 CR -1 05/07/22, 11:21

    on it
  12. Stefan Bürk uploaded patch set 3 05/07/22, 11:31

  13. Oliver Klee commented on patch set 3 CR -1 05/07/22, 11:36

    GeneralUtilityTest.php:3591

    This is PHP-8-only. In order to keep this change backportable to 11.5 (which I'd prefer), we should remove the native type declaration (or keep it at string) and add a PHPDoc type annotation with the union type.
  14. core-ci voted on patch set 3 V -1 05/07/22, 11:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26954

  15. Stefan Bürk uploaded patch set 4 05/07/22, 11:52

  16. Oliver Klee voted on patch set 4 CR +1 05/07/22, 11:52

  17. Oliver Klee commented on patch set 4 05/07/22, 11:52

    GeneralUtilityTest.php:3591 Reply

    Done
  18. Oliver Klee voted on patch set 4 V +1 05/07/22, 11:59

  19. core-ci voted on patch set 4 V +1 05/07/22, 11:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26955

  20. Nikita Hovratov voted on patch set 4 V +1 CR +1 05/07/22, 12:14

  21. Stefan Bürk voted on patch set 4 V +2 CR +2 05/07/22, 12:30

  22. Stefan Bürk merged patch set 5 05/07/22, 12:30