Skip to content
Snippets Groups Projects
  1. Jun 13, 2024
  2. Jun 12, 2024
  3. Jun 11, 2024
  4. Jun 10, 2024
  5. Jun 08, 2024
  6. Jun 07, 2024
  7. Jun 06, 2024
  8. Jun 05, 2024
  9. Jun 04, 2024
    • Christian Kuhn's avatar
      [BUGFIX] Prefer to throw in IdentifierFunctionLine · 9e7025c7
      Christian Kuhn authored
      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.
      
      Resolves: #103977
      Related: #97816
      Releases: main, 12.4
      Change-Id: I772d774fbaae3c2ec7ff4c9abc6ef4964254259d
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/84496
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      9e7025c7