Review main Merged

84495[BUGFIX] Prefer to throw in IdentifierFunctionLine

Christian Kuhn CR +2 V +2 Easy +27 −5 updated 06/04/24, 18:23

Commit message

There is a subtle difference between a PHP error and a
dedicated thrown exception: When an object knows it
should return something, but can't, because it has not
been set up correctly, then the implementation is
responsible of throwing a "i'm incomplete" exception:
This is not an error in the class, but a wrong set up
usage, and this should throw, and should not error out
with a return type mismatch error.

The patch changes two getters of TS parser related
IdentifierFunctionLine to obey this difference and
now throws in case it "has been set up incompletely".

In this case, an IdentifierFunctionLine is only
"complete" after at least an identifier token stream
and a function name token has been set: After being
fully set up, these two properties must have a value.
The object knows this and the two getters now throw
an exception instead of failing with a type error.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Garvin Hicking +1
    • Anja Leichsenring +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Garvin Hicking +1
    • Anja Leichsenring +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1421

  1. Christian Kuhn uploaded patch set 1 06/04/24, 17:02

  2. core-ci voted on patch set 1 V +1 06/04/24, 17:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58691

  3. Christian Kuhn updated the commit message in patch set 2 V +1 06/04/24, 17:11

  4. core-ci voted on patch set 2 V +1 06/04/24, 17:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58692

  5. Christian Kuhn updated the commit message in patch set 3 V +1 06/04/24, 17:15

  6. Christian Kuhn updated the commit message in patch set 4 06/04/24, 17:16

  7. Christian Kuhn updated the commit message in patch set 5 06/04/24, 17:18

  8. core-ci voted on patch set 3 V +1 06/04/24, 17:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58693

  9. Christian Kuhn updated the commit message in patch set 6 06/04/24, 17:22

  10. core-ci voted on patch set 4 V +1 06/04/24, 17:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58694

  11. core-ci voted on patch set 5 V +1 06/04/24, 17:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58695

  12. core-ci voted on patch set 6 V +1 06/04/24, 17:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58696

  13. Garvin Hicking voted on patch set 6 CR +1 V +1 06/04/24, 17:29

  14. Christian Kuhn updated the commit message in patch set 7 CR +1 V +1 06/04/24, 17:31

  15. Garvin Hicking voted on patch set 7 CR +1 V +1 06/04/24, 17:32

  16. Anja Leichsenring voted on patch set 7 CR +1 V +1 06/04/24, 17:33

  17. core-ci voted on patch set 7 V +1 06/04/24, 17:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58697

  18. Stefan Bürk voted on patch set 7 CR +1 V +1 06/04/24, 17:45

  19. Oliver Klee voted on patch set 7 CR +1 V +1 06/04/24, 18:07

  20. Christian Kuhn voted on patch set 7 CR +2 V +2 06/04/24, 18:09

  21. Christian Kuhn merged patch set 8 06/04/24, 18:23