Review main Merged

82056[TASK] Resolve various PHPStan-related issues

Benni Mack CR +2 V +2 Hard +147 −386 updated 12/02/23, 11:32

Commit message

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Benjamin Franzke +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Benjamin Franzke +1
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 19

Review log 1926

Show 1 earlier messages
  1. Benni Mack uploaded patch set 1 12/01/23, 08:16

  1. Benni Mack uploaded patch set 2 12/01/23, 08:23

  2. core-ci voted on patch set 1 V -1 12/01/23, 08:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50195

  3. core-ci voted on patch set 2 V -1 12/01/23, 08:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50196

  4. Benni Mack uploaded patch set 3 V -1 12/01/23, 08:34

  5. core-ci voted on patch set 3 V -1 12/01/23, 08:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50197

  6. Benjamin Franzke commented on patch set 3 12/01/23, 08:46

    ♥
  7. Benni Mack uploaded patch set 4 V -1 12/01/23, 08:48

  8. core-ci voted on patch set 4 V -1 12/01/23, 08:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50198

  9. Benni Mack uploaded patch set 5 V -1 12/01/23, 09:09

  10. core-ci voted on patch set 5 V +1 12/01/23, 09:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50199

  11. Oliver Klee commented on patch set 5 12/01/23, 09:38

    AssetRendererTest.php:31

    A note on the type of mocks: Mocks are always an intersection type of the mocked class/interface and `MockObject`, not a union type (as they are both types at the same time). So in this case, the type should be: `(EventDispatcherInterface&MockObject)|null`
  12. Benjamin Franzke voted on patch set 5 CR +1 12/01/23, 09:38

  13. Oliver Klee commented on patch set 5 12/01/23, 09:39

    And thank you for getting rif of all those PHPStan warnings! <3
  14. Benjamin Franzke uploaded patch set 6 CR +1 V +1 12/01/23, 09:43

  15. Benjamin Franzke commented on patch set 6 12/01/23, 09:43

    AssetRendererTest.php:31 Reply

    Done
  16. core-ci voted on patch set 6 V +1 12/01/23, 09:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50203

  17. Oliver Klee commented on patch set 6 12/01/23, 09:52

    AssetRendererTest.php:31

    This type is now incomplete as it's missing `EventDispatcherInterface`. `(EventDispatcherInterface&MockObject)|null` is be the complete type.
  18. Benjamin Franzke commented on patch set 6 12/01/23, 09:58

    AssetRendererTest.php:31 Reply

    It's actually fine. Only `MockObject` related methods are needed in these testcases. `(EventDispatcherInterface&MockObject)|null` is not an allowed type: Message: syntax error, unexpected token "(", expecting variable
  19. Oliver Klee commented on patch set 6 12/01/23, 14:44

    AssetRendererTest.php:31 Reply

    Yes, this type (with the parenthesis) indeed only works as a PHPDoc annotation (for PHPStan and the human reader), not as a native type declaration. In this case, we can simplify this to `MockObject&EventDispatcherInterface` though (without losing information for the reader) as this property does not need to be nullable. (It's set in `setUp()` and never accessed before.) I'm going to push an updated changeset in a minute.
  20. Oliver Klee uploaded patch set 7 CR +1 V +1 12/01/23, 14:44

  21. core-ci voted on patch set 7 V +1 12/01/23, 14:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50210

  22. Benjamin Franzke voted on patch set 7 CR +1 V +1 12/01/23, 16:44

  23. Oliver Klee voted on patch set 7 V +1 12/02/23, 08:51

  24. Christian Kuhn voted on patch set 7 CR +2 V +2 12/02/23, 11:32

  25. Christian Kuhn merged patch set 8 12/02/23, 11:32