Narrow data type in Symfony NormalizerInterface implementations #823
andyexeter
started this conversation in
General
Replies: 1 comment 2 replies
-
|
you can use |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
The following, stripped down example of implementing the symfony/serializer package's
NormalizerInterfacecurrently triggers aincompatible-parameter-typeerror:Playground link: https://mago.carthage.software/playground#019b4a8d-4bf3-a64f-8f82-9eb3e6b32e05
There is no error given in PHPStan.
We know that the
$dataargument given tonormalizewill always be an object, becausenormalizewill only be called ifsupportsNormalizationreturns true.I'm not sure if this is a bug per se, hence not reporting this as an issue - but how can I prevent Mago reporting this error?
Beta Was this translation helpful? Give feedback.
All reactions