93623[TASK] Make DomainObjectInterface non-internal
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Benjamin Franzke +1
- Markus Klein +1
- Torben Hansen +1
- Stefan Bürk +1
- Sebastian Iffland +1
- Christian Kuhn +1
-
Verified V +2 Done
- Garvin Hicking +2
- Benjamin Franzke +1
- Markus Klein +1
- Torben Hansen +1
- Stefan Bürk +1
- Sebastian Iffland +1
- Christian Kuhn +1
- core-ci +1 CI
Issues 2
Files 1
Review log 1820
-
Oliver Klee uploaded patch set 1 04/11/26, 10:26
-
core-ci voted on patch set 1 V +1 04/11/26, 10:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99958
-
Sebastian Iffland commented on patch set 1 CR +1 V +1 04/13/26, 05:44
LGTM! One curiosity in wording in class description, off topic: `Usually you will need to subclass \TYPO3\CMS\Extbase\DomainObject\AbstractEntity and \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject instead.` -> Don't really get the point, 'instead of' what? This made it in [6.2.0](https://github.com/TYPO3/typo3/commit/eb8d7696bd276013cb2c73e6265b5a2590711e35), so pretty ancient. -
Oliver Klee commented on patch set 1 04/14/26, 14:57
Reply
There, I fixed it: https://review.typo3.org/c/Packages/TYPO3.CMS/+/93667 :-) -
Oliver Klee wrote 04/14/26, 14:58
Topic set to extbase -
Oliver Klee rebased onto patch set 2
CR +1V +104/14/26, 19:44 -
core-ci voted on patch set 2 V +1 04/14/26, 19:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100197
-
Garvin Hicking voted on patch set 2 CR +1 V +1 04/14/26, 20:00
-
Markus Klein voted on patch set 2 CR +1 V +1 04/16/26, 10:02
-
Torben Hansen voted on patch set 2 CR +1 V +1 04/16/26, 10:19
-
Sebastian Iffland voted on patch set 2 CR +1 V +1 04/16/26, 10:21
-
Stefan Bürk voted on patch set 2 CR +1 V +1 04/16/26, 11:30
-
Christian Kuhn voted on patch set 2 CR +1 V +1 04/16/26, 11:52
-
Garvin Hicking commented on patch set 2 CR -1 04/16/26, 13:36
Unresolved
We'll merge very likely this, but will also have a look at the followup goal first. Temporary block only. -
Oliver Klee commented on patch set 2 04/16/26, 14:25
This is the type of warning I'd like to avoid: https://github.com/oliverklee-de/onetimeaccount/actions/runs/24515596544/job/71658520585?pr=1225#step:8:26 -
Oliver Klee commented on patch set 2 04/16/26, 14:51
There are two possible paths forward after this: a) make AbstractDomainObject non-internal (and make only some methods internal: https://review.typo3.org/c/Packages/TYPO3.CMS/+/92998 b) pull down the UID and PID setters to AbstractEntity and AbstractValueObject: https://review.typo3.org/c/Packages/TYPO3.CMS/+/93693 -
Benjamin Franzke voted on patch set 2 CR +1 V +1 04/16/26, 16:22
-
Garvin Hicking commented on patch set 2 CR +2 V +2 04/16/26, 16:27
This one is undisputed by everyone. The follow-ups cause a bit of concern: We cannot open up the whole of AbstractDomainObject (and only internal-ize specific methods), because this would allow consumers to extend an internal abstract that we don't want to allow extended. Only (as thanks to your help we also formulatted better) the AbstractEntity and AbstractValueObject should be extended - and removing `@internal` there would then be indicative of "proper API use". We can't easily forbid this (unless using runtime class extension analysis and throwing exceptions). Moving vital getUid/getPid methods around might also cause breakage. There are (ugly) workarounds possible that we can discuss in the follow-up issues. For now, let's go babysteps and at least use this patch here which improves the situation a bit to allow such workarounds: ``` $data[] = $this->getUid($blog); // ... private function getUid(DomainObjectInterface $object): ?int { return $object->getUid(); } ``` or ``` /** @var DomainObjectInterface $object */ $object = $blog; $data[] = $object->getUid(); ``` (using `$blog->...` accessors for the actual implementation, and `$object` for type-hinted abstract method-level access). Hat tip to Benjamin Franzke for coming up with this, but I see that is a work-around and not a solution. Moving the methods might be something for v15 of course. -
Benjamin Franzke commented on patch set 2 04/16/26, 16:28
Works for me via ``` /** @var DomainObjectInterface $object */ $object = $myobject; $object->getUid(); ``` There is still a PHPstan bug, which prevents direct public API derivation based on `$myobject`, but that is really an analysation bug which we should try to get fixed upstream in PHPstan. -
Garvin Hicking merged patch set 3 04/16/26, 16:38