Problem/Motivation
Method "Symfony\Component\Serializer\Normalizer\DenormalizerInterface::denormalize()" will return "mixed" as of its next major version.
Steps to reproduce
Proposed resolution
Add the "mixed" return type hint.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3232080-7.patch | 13.35 KB | paulocs |
| #7 | diff-2-7.txt | 1.26 KB | paulocs |
| #2 | 3232080-2.patch | 12.64 KB | daffie |
Comments
Comment #2
daffie commentedThe problem for adding this return type hint is that a lot of contrib modules override the method. See: http://grep.xnddx.ru/search?text=public+function+denormalize%28&filename=. Maybe we need to wait for D10.0 to commit this patch.
Comment #3
catchI don't think we can change EntityDenormalizerBase, but we should be able to do all the non-base classes in Drupal 9?
Comment #4
daffie commentedI do not think we can do this change in a 9.x branch as the method is overridden a lot in contrib and therefor would result in a BC break. See: http://grep.xnddx.ru/search?text=public+function+denormalize%28&filename=.
Part of the Symfony 6 in D10 initiative.
Comment #5
daffie commentedThe "mixed" return type hint is only supported from PHP version 8.0.
Comment #6
longwaveWhat about:
Comment #7
paulocsI did a re-roll and addressed #6.
Comment #8
longwaveThanks, this looks good for 10.0.x now.
Comment #9
catchCommitted 45630c7 and pushed to 10.0.x. Thanks!