-
-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix iterable::class that does not exist #1315
Conversation
Tobion
commented
Apr 23, 2021
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
Doc updated | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | |
License | MIT |
foreach (self::SUPPORTED_FORMATS as $format) { | ||
$methods[] = [ | ||
'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION, | ||
'type' => iterable::class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iterable is a psydo class and does not really exist. this is resolved as a class in the current namespace, i.e. JMS\Serializer\Handler\iterable
which does not exist. this is why phpstan complained rightfully.
also the whole registration of iterable
is pointless because iterables are already handled directly in the graph visitor (like for array, int etc). so to my understading, this part is irrelevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, then why not put just 'iterable'
as string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it wouldn't do anything? iterables are not handled via registration.
/** | ||
* @param mixed $data | ||
*/ | ||
public function deserializeIterable( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it mean that we do not have anymore the deserialization for iterable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do. it's inside the graph visistor/navigator itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see
serializer/src/GraphNavigator/DeserializationGraphNavigator.php
Lines 137 to 138 in f908d17
case 'iterable': | |
return $this->visitor->visitArray($data, $type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh, i forgot about that!
thanks! |