Problem/Motivation
Method "Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize()" will return "array|string|int|float|bool|\ArrayObject|null" as of its next major version.
This deprecation warning is given by Symfony 5.4 that in Symfony 6 the return value must be of the type: array|string|int|float|bool|\ArrayObject|null.
In #3232074: [Symfony 6] Add "array|string|int|float|bool|\ArrayObject|null" to all Normalizer classes that implement the method ::normalize() we fixed CacheableNormalizations as they are not one of the listed types, but we did not resolve the deprecation warnings.
Proposed resolution
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3254331-4.patch | 28.17 KB | paulocs |
| #4 | interdiff-2-4.txt | 600 bytes | paulocs |
| #2 | 3254331-2.patch | 27.46 KB | longwave |
Comments
Comment #2
longwaveReposting #5 from the linked issue, credit to @daffie for creating this patch.
Comment #3
paulocsI was doing a review and noticed that
Drupal\jsonapi\Serializer\Serializer::normalize()is missing the return type too.Comment #4
paulocsNew patch and interdiff.
Comment #6
paulocsI triggered the tests again and the tests pass. Previously the tests triggered unrelated failures.
Moving to Needs review again.
Comment #7
beatrizrodriguesI'll do the review
Comment #8
beatrizrodriguesPatch seems good to me. I ran the tests locally and there was no problem. The patch from #2 missed one of the ::normalize() implementations, indeed. The patch sent in #6 applied well and solved the problem. It's RTBC to me.
Comment #9
alexpottCommitted 00ad1d7 and pushed to 10.0.x. Thanks!