Review main Merged

73217[FEATURE] Introduce Attributes for Extbase Annotations

Susi Moog CR +2 V +2 Hard +513 −2 updated 02/08/22, 17:01

Commit message

Since PHP 8, native attributes are supported. In comparison to
annotations, attributes have auto-completion, are better readable
and were "invented" for storing meta-information about properties.

Extbase annotations are already nearly 1:1 translatable to attributes.

The following annotations have been enriched for usage as attributes:

@Extbase\ORM\Transient
@Extbase\ORM\Cascade
@Extbase\ORM\Lazy
@Extbase\IgnoreValidation
@Extbase\Validate

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Stefan Bürk +1
    • Benni Mack +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 17

Review log 911

  1. Susi Moog uploaded patch set 1 01/30/22, 10:12

  2. core-ci voted on patch set 1 V +1 01/30/22, 10:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22708

  3. Benni Mack voted on patch set 1 CR +1 02/05/22, 22:10

  4. Stefan Bürk updated the commit message in patch set 2 02/06/22, 20:37

  5. Stefan Bürk voted on patch set 2 CR +1 02/06/22, 20:37

  6. core-ci voted on patch set 2 V +1 02/06/22, 20:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23111

  7. Benni Mack voted on patch set 2 V +1 CR +1 02/07/22, 12:13

  8. Christian Kuhn commented on patch set 2 02/07/22, 12:41

    The general issue i have with this patch: it makes the complex class "ClassSchema" even more complex. I think we should at least think about which other parts could be deprecated with possibly further patches to somehow bring the class towards a manageable state mid-term.
  9. Susi Moog commented on patch set 2 02/07/22, 13:41

    Maybe a bit of my thoughts that may help you form a decision - we could (in addition or instead of this patch): - deprecate the annotations (and get rid of all the annotation code in classSchema midTerm) - implement the attributes as separate classes with a separate attributeClassSchemaService (naming things) with their own logic - replace the validation from extbase with a different validation component completely (mid-term removing the maintenance burden on our side, as long as we choose a stable-enough reliable lib) This patch is the easiest solution as it is completely mirroring the annotation behaviour we have now and it could be combined with the deprecation part. The second solution above would introduce variability / differences in handling of attributes and annotations but would allow "better" constructors for the attributes. The third solution depends on research into validators, I think Alex has a linked patch where he looked into symfony/validator, however, I have no idea how far that was and whether that supports attributes or not.
  10. Georg Ringer voted on patch set 2 V +2 CR +2 02/08/22, 17:01

  11. Georg Ringer merged patch set 3 02/08/22, 17:01