Review main Merged

61517[BUGFIX] Fix AnnotationException

TYPO3com CR +2 V +2 Easy +2 −2 updated 08/23/19, 11:49

Commit message

Doctrine\Common\Annotations\AnnotationException
[Semantical Error] The annotation "@mkdir" in method
TYPO3\CMS\Core\Utility\GeneralUtility::mkdir() was never imported. Did you
maybe forget to add a "use" statement for this annotation?

Review

  • Code review CR +2 Done
    • Frank Nägler +2
    • Guido Schmechel +1
    • Alexander Schnitzler +1
    • Anja Leichsenring +1
  • Verified V +2 Done
    • Frank Nägler +2
    • Alexander Schnitzler +1
    • Anja Leichsenring +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1823

  1. TYPO3com uploaded patch set 1 08/20/19, 12:12

  2. TYPO3com voted on patch set 1 V +1 08/20/19, 12:24 Completed build in 11m 53s on Tue, 20 Aug, 12:24 PM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35744

  3. Daniel Huf commented on patch set 2 08/20/19, 12:31

    Published edit on patch set 1.
  4. TYPO3com voted on patch set 2 V +1 08/20/19, 12:41 Completed build in 10m 51s on Tue, 20 Aug, 12:41 PM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35746

  5. Alexander Schnitzler commented on patch set 2 08/20/19, 15:38

    I'd like to know how this happens because GeneralUtility should never be analysed by the AnnotationParser. So, what do you do to get this Exception? Then, this is missing a test. Last but not least I'd like to talk about the fix. I'd rather remove the @ and explain that the native php functions are meant. Besides that, I personally don't even see any need for the explanation at all...
  6. Oliver Klee commented on patch set 2 08/20/19, 19:25

    GeneralUtility.php:2040 Unresolved

    Do we need to have the @ in the comment in the first place for it to be meaningful?
  7. Anja Leichsenring commented on patch set 3 08/23/19, 09:43

    Published edit on patch set 2.
  8. Anja Leichsenring commented on patch set 4 08/23/19, 09:44

    Published edit on patch set 3.
  9. Anja Leichsenring voted on patch set 4 V +1 CR +1 08/23/19, 09:44

  10. TYPO3com voted on patch set 3 V -1 08/23/19, 09:55 Completed build in 11m 35s on Fri, 23 Aug, 09:55 AM Test Summary: 1 of 47570 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35789

  11. TYPO3com voted on patch set 4 V +1 08/23/19, 09:56 Completed build in 12m 04s on Fri, 23 Aug, 09:56 AM Test Summary: 47211 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35790

  12. Guido Schmechel voted on patch set 4 CR +1 08/23/19, 10:03

  13. Anja Leichsenring commented on patch set 4 V 0 CR -1 08/23/19, 10:29

    the reason is a bug in the annotationParser, that should only care for '@' if it is in the first position of the line, not in the middle. So yes, the patch removes the error. But it does not resolve the issue.
  14. Frank Nägler commented on patch set 4 CR -1 08/23/19, 10:29

    I would like to have feedback by Alex. From my point of view, this is an issue in the parser. The annotations should be checked only if the @ is the first character, or not?
  15. Frank Nägler commented on patch set 4 08/23/19, 10:43

    Also without a stack trace or guide how to reproduce this is not possible to verify or find the correct solution.
  16. Alexander Schnitzler commented on patch set 4 V +1 CR +1 08/23/19, 10:59

    I don't know if the php doc standard explicitly allows or disallows annotations in the middle of sentences or if it bans them to the beginning of a new line but from how doctrine/annotations works, I guess that it's ok to have annotations everywhere. I don't find any RFC, so I can't say if the library is buggy or not. However, as stated earlier, the core only gathers information regarding doctrine annotations for those classes a ClassSchema is created for. So, the main question is: What do you need to do wrong if Extbase generates a ClassSchema for a class like GeneralUility which is not meant to be instantiated. What we can do is two different things: - Register globally allowed tags, that are not part of the already globally allowed standard tags, defined here: https://docs.phpdoc.org/references/phpdoc/tags/index.html - Remove all globally used non standard tags like @mkdir and such. I'd propose to do the latter and to streamline all standard tags that are not used correctly. The latter is a different topic but we have those as well. Thus, I'll vote +1 for the current solution.
  17. Frank Nägler commented on patch set 4 CR 0 08/23/19, 11:16

    thx Alex, anyway the looks fishy, IIRC a @ sign must still be possible in a DocBlock
  18. Alexander Schnitzler commented on patch set 4 08/23/19, 11:26

    > Patch Set 4: -Code-Review > > thx Alex, anyway the looks fishy, IIRC a @ sign must still be possible in a DocBlock It is possible, if you use the standard tags, defined in the phpDoc reference. The standard defines regular tags, that are used at the beginning of the line and it defines a few inline-tags (https://docs.phpdoc.org/references/phpdoc/inline-tags/index.html), that are to be used with curly braces: {@link foo} e.g. I'd say, let's remove the @ in this case because @mkdir does not have any function at all.
  19. Frank Nägler commented on patch set 4 CR -1 08/23/19, 11:31

    -1 again, I want to know why and in which context this happens. I don't know why doctrine annotations should analyze the GU class,
  20. Anja Leichsenring commented on patch set 4 V +1 CR +1 08/23/19, 11:47

    > Patch Set 4: Code-Review-1 > > -1 again, I want to know why and in which context this happens. > I don't know why doctrine annotations should analyze the GU class, we got answer from the author, the reason was that they initalized the GU class by passing it into a constructor and therefor invoking dependency injection. So the parser kicked in and chocked at the not known tag.
  21. Frank Nägler voted on patch set 4 CR 0 08/23/19, 11:48

  22. Frank Nägler voted on patch set 4 V +2 CR +2 08/23/19, 11:49

  23. Frank Nägler merged patch set 5 08/23/19, 11:49