Review main Merged

54510[BUGFIX] Add checks to ReflectionService to have correct return values

Markus Klein CR +2 V +2 Easy +30 −16 updated 11/02/17, 15:46

Commit message

Review

  • Code review CR +2
    • Susi Moog +2
    • Alexander Schnitzler +1
  • Verified V +2
    • Susi Moog +2
    • Alexander Schnitzler +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 2228

Show 23 earlier messages
  1. Markus Klein uploaded patch set 1 10/31/17, 06:51

  2. TYPO3com voted on patch set 1 V +1 10/31/17, 07:00 Completed build in 09m 12s on Tue, 31 Oct, 08:00 AM Test Summary: 56936 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15938

  3. Wouter Wolters commented on patch set 1 CR +1 10/31/17, 07:46

    ReflectionService.php:70

    maybe not for this change but we are calling the caching framework twice here. In all other places we use only on get, and check the result of that instead of using has and get both.
  1. Tymoteusz Motylewski commented on patch set 1 10/31/17, 08:09

    ReflectionService.php:70 Reply

    if we're already changing the line, I would be for fixing it right away. However I don't get why did you remove the !== false check, can you shed some light Markus?
  2. Markus Klein commented on patch set 1 10/31/17, 17:12

    ReflectionService.php:70 Reply

    ->has() returns a bool, no need to do any further cpu cycles with useless comparisons.
  3. Markus Klein uploaded patch set 2 10/31/17, 17:14

  4. TYPO3com voted on patch set 2 V +1 10/31/17, 17:23 Completed build in 09m 15s on Tue, 31 Oct, 06:23 PM Test Summary: 56936 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15946

  5. Alexander Schnitzler commented on patch set 1 11/01/17, 18:44

    ReflectionService.php:70 Reply

    Someone must have changed that line when I was on holidays. When I first wrote the patch I checked for ->get being not false, which made sense back then. Double checking a bool makes no sense for sure.
  6. Alexander Schnitzler commented on patch set 2 11/01/17, 19:11

    ReflectionService.php:300

    Why did you remove that statement? It's valid as new ClassSchema($className) might throw such an exception.
  7. Markus Klein commented on patch set 2 11/02/17, 08:16

    ReflectionService.php:300 Reply

    Hm... PHPStorm says it's never thrown and using the pure search function doesn't reveal a place (except Doctrine) as well, where this might be thrown.
  8. Alexander Schnitzler commented on patch set 2 11/02/17, 09:46

    ReflectionService.php:300 Reply

    Strange, my PHPStorm says otherwise and it's true. $classSchema = new ClassSchema($className); might throw that exception.
  9. Susi Moog commented on patch set 2 11/02/17, 09:50

    ReflectionService.php:300 Reply

    new ClassSchema calls new \ReflectionClass($className) -> see http://php.net/manual/en/reflectionclass.construct.php -> that one may throw an \ReflectionException which is not caught anywhere - so the doc comment here is valid.
  10. Alexander Schnitzler commented on patch set 2 11/02/17, 10:25

    ReflectionService.php:300 Reply

    Quote: »Throws ReflectionException if the class to reflect does not exist.« Currently we double check for the existance of the class. Once implicitly in the constructor and explicitly with class_exists($className). We could simplify that. I will push a new patchset for that.
  11. Alexander Schnitzler commented on patch set 2 11/02/17, 10:26

    btw: are you sure about backporting that to 8.7?
  12. Alexander Schnitzler uploaded patch set 3 11/02/17, 10:31

  13. TYPO3com voted on patch set 3 V +1 11/02/17, 10:40 Completed build in 08m 47s on Thu, 2 Nov, 11:40 AM Test Summary: 56930 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15980

  14. Alexander Schnitzler uploaded patch set 4 11/02/17, 10:46

  15. TYPO3com voted on patch set 4 V +1 11/02/17, 10:56 Completed build in 10m 23s on Thu, 2 Nov, 11:56 AM Test Summary: 56930 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15981

  16. Alexander Schnitzler commented on patch set 4 11/02/17, 13:29

    ReflectionService.php:240

    Actually this check is not needed here because isPropertyTaggedWith already returns the empty array if the tag is not set but we can still keep it.
  17. Alexander Schnitzler uploaded patch set 5 11/02/17, 13:31

  18. TYPO3com voted on patch set 5 V -1 11/02/17, 13:39 Completed build in 07m 34s on Thu, 2 Nov, 02:39 PM Test Summary: 2 of 57289 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15990

  19. TYPO3com voted on patch set 5 V +1 11/02/17, 13:41 Completed build in 17m 37s on Thu, 2 Nov, 02:41 PM Test Summary: 56930 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15990

  20. Alexander Schnitzler voted on patch set 5 CR +1 V +1 11/02/17, 13:42

  21. Susi Moog voted on patch set 5 CR +2 V +2 11/02/17, 13:46

  22. Gerrit merged patch set 5 11/02/17, 13:46

  23. Susi Moog commented on patch set 6 11/02/17, 14:33

    a bit late for that question, but does this really need an 8.7 backport seeing as the code there is majorly different?
  24. Alexander Schnitzler commented on patch set 6 11/02/17, 14:35

    I wondered about that myself and I would not consider a backport at all because the preceding patches were master only.
  25. Markus Klein commented on patch set 6 11/02/17, 15:46

    Skip the backport. This was a mistake of mine!