Review main Merged

68898[BUGFIX] Remove deprecated reflection API usage

crell CR +2 V +2 Normal +35 −22 updated 05/04/21, 13:50

Commit message

PHP 8 deprecated a number of very old bits of the Reflection API. This
patch updates ClassSchema to use the newer equivalents.

Also fixes some unrelated PHP 8.0 errors around undefined value handling.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • Oliver Hader +1
  • Verified V +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1925

  1. crell uploaded patch set 1 04/27/21, 22:51

  2. Benni Mack commented on patch set 1 04/27/21, 23:12

    Also see this approach: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66936 which was merged (also in v10.4) and reverted again here back then https://review.typo3.org/c/Packages/TYPO3.CMS/+/68329
  3. crell uploaded patch set 2 04/28/21, 18:23

  4. Benni Mack commented on patch set 2 04/28/21, 20:41

    ClassSchema.php:417 Unresolved

    this is the problem. So if you throw in "string" because your class has a contructor with class myclass { public __construct(string $myVar) { .. } } then previously this was NOT a instanceof ReflectionClass, but is now of type "ReflectionNamedType" (why-so-ever, I don't have any clue about this internals of PHP). Anyway, if I do this: if ($reflectionType instanceof \ReflectionNamedType && !$reflectionType->isBuiltin() ... we're good to go. PHP stinks when dealing with internal throwing exceptions and you don't have a proper stack trace btw.
  5. crell uploaded patch set 3 04/30/21, 17:05

  6. Benni Mack uploaded patch set 4 04/30/21, 18:39

  7. core-ci voted on patch set 4 V -1 04/30/21, 20:40 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/10982

  8. Alexander Schnitzler wrote 05/01/21, 06:31

    Topic set to extbase
  9. crell uploaded patch set 5 05/03/21, 17:36

  10. crell commented on patch set 5 05/03/21, 17:38

    The latest patch still has 3 functional test fails, but none appear to be related to Reflection or ClassSchema. (I think; I've not dug into them yet, but the error messages appear to be separate.) I'm not sure if it's better to commit this now and do those separately or turn this into a general "all the PHP 8 functional tests!" issue.
  11. core-ci voted on patch set 5 V -1 05/03/21, 17:50 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11060

  12. crell uploaded patch set 6 05/03/21, 18:07

  13. core-ci voted on patch set 6 V -1 05/03/21, 18:20 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11062

  14. crell uploaded patch set 7 05/03/21, 18:46

  15. core-ci voted on patch set 7 V -1 05/03/21, 18:59 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11065

  16. Benni Mack uploaded patch set 8 05/03/21, 19:36

  17. Benni Mack voted on patch set 8 V +1 CR +1 05/03/21, 19:37

  18. core-ci voted on patch set 8 V -1 05/03/21, 19:46 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11068

  19. Benni Mack uploaded patch set 9 05/03/21, 19:48

  20. core-ci voted on patch set 9 V +1 05/03/21, 20:01 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11070

  21. Benni Mack voted on patch set 9 V +1 CR +1 05/03/21, 20:01

  22. Oliver Hader voted on patch set 9 CR +1 05/03/21, 20:20

  23. Christian Kuhn voted on patch set 9 V +1 CR +1 05/04/21, 13:47

  24. Benni Mack voted on patch set 9 V +2 CR +2 05/04/21, 13:50

  25. Benni Mack merged patch set 10 05/04/21, 13:50