Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2025 at 21:14 UTC
Updated:
5 May 2026 at 09:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
mondrakeComment #4
smustgrave commentedshould instances like
Be updated now that the comments are being taken over by core? I mean should the return for each instance only show what it can actually return with a comment that reflects that.
Comment #5
mondrakeRe. #4: these are all normalization methods that more or less inherit from upstream https://github.com/symfony/symfony/blob/8.1/src/Symfony/Component/Serial...
"more or less" because not all of them inherit directly, some are just related and the inheritdoc does not really pick from the class hierarchy. That's why I added explicit comments.
That said, the interface definition is
public function normalize(mixed $data, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null;I already narrowed the return type when I was certain of the returned value, and left the original interface return type in the rest of the instances. Please note that type narrowing may have BC concerns.
Comment #6
mondrakeComment #7
smustgrave commentedBased on #5 believe this is probably good. Don't want to get into the weeds.
Comment #8
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #9
nod_local blip
Comment #11
amateescu commentedCommitted 3659d1b and pushed to main. Thanks!
We'll need a 11.x MR for backporting.
Comment #13
mondrakeComment #15
mondrake11.x port
Comment #16
amateescu commentedCommitted ca9f9be and pushed to 11.x. Thanks!
Comment #20
idebr commentedThis broke HAL's \Drupal\hal\Normalizer\FieldNormalizer and subsequently webform tests: https://git.drupalcode.org/issue/webform-3550117/-/pipelines/797824/test...
Comment #22
godotislateConsulted with other release managers @catch and @xjm and noting here that the return type changes are allowed for Drupal 11.4.0, because normalizers are tagged services and not considered public API per Drupal core's backwards compatibility policy.
For visibility, I have published a CR documenting the changes: https://www.drupal.org/node/3588047
Comment #23
tobiasb@godotislate
There is also another CR.
https://www.drupal.org/node/3588046
The CR is now a draft again.