Review main Merged

89095[TASK] Demonstrate extbase model with constructor parameter promotion

Lina Wolf CR +2 V +2 Hard +358 −0 updated 04/19/25, 11:01

Commit message

This change adds a Extbase Domain Model using the PHP language
feature `Constructor Parameter Promotion` along with required
`initializeObject()` to ensure property initalization, which
includes for manual instantiating using `new` keyword and also
when hydrated by the Extbase ORM omitting calling `__construct()`
on the model.

Review

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

Issues 1

Files 4

Review log 810

  1. Lina Wolf uploaded patch set 1 04/13/25, 10:08

  2. core-ci voted on patch set 1 V -1 04/13/25, 10:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77672

  3. Stefan Bürk uploaded patch set 2 V -1 04/18/25, 16:14

  4. core-ci voted on patch set 2 V +1 04/18/25, 16:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77945

  5. Stefan Bürk voted on patch set 2 CR +1 V +1 04/18/25, 16:52

  6. Georg Ringer voted on patch set 2 CR +1 V +1 04/19/25, 05:59

  7. Lina Wolf commented on patch set 2 CR +1 V +1 04/19/25, 06:02

    As I only submitted a quick POC, but the changes came from Stefan Bürk rely, reviewing them. Tests work and the code looks good to me. Happy, we have tests for this.
  8. Lina Wolf commented on patch set 2 04/19/25, 06:04

    A topic that I would still be missing is how to use valdiation in combination with constructor promotion, expecially if we are dealing with public properties and there are no getters and setters. This is probably beyond the scope of this PR
  9. Stefan Bürk commented on patch set 2 CR +2 V +2 04/19/25, 10:45

    Reply

    This should work with CPP as long as the property is correctly initalized, not sure about the annotations but with PHP Attributes this should be possible: https://review.typo3.org/c/Packages/TYPO3.CMS/+/89173
  10. Stefan Bürk merged patch set 3 04/19/25, 11:01