Review main Merged

97367[BUGFIX] Resolve doc comment intersection types in Extbase ClassSchema

Oli Bartsch CR +2 V +2 Normal +68 −145 updated 11/06/26, 09:36

Commit message

ClassSchema read property types from doc comments with the
PhpDocExtractor of symfony/property-info, which is based on
phpdocumentor. It turned "@var \ArrayAccess&\Traversable" into the
non-existing class name "ArrayAccess&\Traversable", and since
symfony/property-info 8.1.11 it ignores intersection types, leaving
such a property without any type.

ClassSchema now uses the PhpStanExtractor, which is based on
phpstan/phpdoc-parser, already a requirement of Extbase. It resolves
doc comment intersection types to an IntersectionType, so such a
property gets both types, as native intersection types already do.

ClassSchema was the only consumer of phpdocumentor/reflection-docblock,
so the requirement is dropped. phpdocumentor/type-resolver stays, the
PhpStanExtractor needs it to resolve class names against use
statements.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Benni Mack +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Benni Mack +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 2431

Show 46 earlier messages
  1. Oli Bartsch uploaded patch set 1 11/05/26, 10:37

  2. Oli Bartsch uploaded patch set 2 11/05/26, 10:47

  3. core-ci voted on patch set 1 V +1 11/05/26, 11:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113389

  4. core-ci voted on patch set 2 V +1 11/05/26, 11:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113392

  5. Oliver Klee voted on patch set 2 V +1 11/05/26, 11:44

  6. Markus Klein commented on patch set 2 CR +1 V +1 11/05/26, 12:25

    Nice!
  1. Markus Klein commented on patch set 2 11/05/26, 12:27

    Can we actually drop the composer req "phpdocumentor/reflection-docblock": "^6.0.3 now?
  2. Oliver Klee commented on patch set 2 11/05/26, 12:32

    Reply

    I've just checked: This was the last usage of any classes from the `phpDocumentor\Reflection` namespace. So we indeed probably can drop the dependency.
  3. Oli Bartsch uploaded patch set 3 CR +1 V +1 11/05/26, 13:10

  4. Oliver Klee voted on patch set 3 CR +1 11/05/26, 13:14

  5. Oli Bartsch uploaded patch set 4 CR +1 11/05/26, 13:15

  6. Benni Mack voted on patch set 4 CR +1 V +1 11/05/26, 13:20

  7. core-ci voted on patch set 3 V +1 11/05/26, 13:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113404

  8. Oli Bartsch uploaded patch set 5 CR +1 V +1 11/05/26, 13:21

  9. Oliver Klee commented on patch set 5 CR +1 V +1 11/05/26, 13:23

    Reply

    Done
  10. core-ci voted on patch set 4 V +1 11/05/26, 13:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113406

  11. core-ci voted on patch set 5 V +1 11/05/26, 13:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113408

  12. Benni Mack voted on patch set 5 CR +1 V +1 11/05/26, 14:20

  13. Markus Klein commented on patch set 5 11/05/26, 16:24

    composer.json:83

    not used anymore as well, right?

    composer.json:36

    not used anymore as well, right?
  14. Markus Klein uploaded patch set 6 CR +1 V +1 11/05/26, 16:26

  15. Markus Klein commented on patch set 5 11/05/26, 16:27

    composer.json:83 Reply

    Done

    composer.json:36 Reply

    Done
  16. Oliver Klee voted on patch set 6 CR +1 V +1 11/05/26, 16:56

  17. core-ci voted on patch set 6 V -1 11/05/26, 17:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113415

  18. Markus Klein commented on patch set 6 11/05/26, 17:11

    Hell: Message was: "Unable to use the "Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor" class as the "phpdocumentor/type-resolver" package is not installed. Am I right... they have a dependency issue?
  19. Oli Bartsch uploaded patch set 7 CR +1 V +1 11/06/26, 08:51

  20. Oli Bartsch commented on patch set 7 11/06/26, 08:53

    Reply

    PhpStanExtractor needs `phpdocumentor/type-resolver` (constructor checks `class_exists(ContextFactory)`), but `symfony/property-info` only lists it as optional. So we must keep requiring it ourselves.
  21. core-ci voted on patch set 7 V +1 11/06/26, 09:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113466

  22. Benni Mack voted on patch set 7 CR +1 V +1 11/06/26, 09:16

  23. Simon Schaufelberger voted on patch set 7 CR +1 V +1 11/06/26, 09:30

  24. Oli Bartsch voted on patch set 7 CR +2 V +2 11/06/26, 09:36

  25. Oli Bartsch merged patch set 8 11/06/26, 09:36