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

CommentFileSizeAuthor
#4 3254331-4.patch28.17 KBpaulocs
#4 interdiff-2-4.txt600 bytespaulocs
#2 3254331-2.patch27.46 KBlongwave

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review
StatusFileSize
new27.46 KB

Reposting #5 from the linked issue, credit to @daffie for creating this patch.

paulocs’s picture

Status: Needs review » Needs work

I was doing a review and noticed that Drupal\jsonapi\Serializer\Serializer::normalize() is missing the return type too.

paulocs’s picture

Status: Needs work » Needs review
StatusFileSize
new600 bytes
new28.17 KB

New patch and interdiff.

Status: Needs review » Needs work

The last submitted patch, 4: 3254331-4.patch, failed testing. View results

paulocs’s picture

Status: Needs work » Needs review

I triggered the tests again and the tests pass. Previously the tests triggered unrelated failures.

Moving to Needs review again.

beatrizrodrigues’s picture

Assigned: Unassigned » beatrizrodrigues

I'll do the review

beatrizrodrigues’s picture

Assigned: beatrizrodrigues » Unassigned
Status: Needs review » Reviewed & tested by the community

Patch 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.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 00ad1d7 and pushed to 10.0.x. Thanks!

  • alexpott committed 00ad1d7 on 10.0.x
    Issue #3254331 by paulocs, longwave: [Symfony 6] Add "array|string|int|...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.