Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress

98077[BUGFIX] Prefer declared property type over getter and setter types

Alexander Schnitzler CR +1 V +1 Hard +331 −0 updated 11/26/26, 18:44

Commit message

ClassSchema derives property types through Symfony PropertyInfo,
which consults setter parameters and getter return types before the
property declaration. A property like `protected string $items` with
`getItems(): array` was therefore typed as array, never mapped by
the DataMapper and left uninitialized.

The type of the property declaration now wins when the type found
via getters or setters contradicts it. Compatible refinements, such
as generics documented at the getter, are kept. Untyped properties
still fall back to getter and setter types.

Only properties with a single native type are covered. Union types
declared at the property or returned by getters and setters keep
their current behaviour.
Show more Show less

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 1
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/77/98077/1 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/77/98077/1 && git cherry-pick FETCH_HEAD

Review

  • Code review CR +1 Needs a vote
    • Benni Mack +1
  • Verified V +1 Needs a vote
    • Benni Mack +1
    • core-ci +1 CI

Issues 3

Files 6

Review log 56

  1. Alexander Schnitzler uploaded patch set 1 11/26/26, 16:11

  2. Alexander Schnitzler wrote 11/26/26, 16:13

    Topic set to extbase
  3. core-ci voted on patch set 1 V +1 11/26/26, 16:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/115588

  4. Alexander Schnitzler commented on patch set 1 11/26/26, 16:44

  5. Benni Mack voted on patch set 1 CR +1 V +1 11/26/26, 18:44

  6. Alexander Schnitzler marked it work in progress 11/26/26, 18:44