Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Serializer][Validator] Fix not null return from "getCollectionValueTypes"#41463
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
c428704 toc4dcfd1Compare| [$context['key_type']] =$collectionKeyType; | ||
| } | ||
| }elseif ($type->isCollection() &&null !==($collectionValueType =$type->getCollectionValueTypes()) &&\count($collectionValueType) >0 && Type::BUILTIN_TYPE_ARRAY ===$collectionValueType[0]->getBuiltinType()) { | ||
| }elseif ($type->isCollection() &&\count($collectionValueType =$type->getCollectionValueTypes()) >0 && Type::BUILTIN_TYPE_ARRAY ===$collectionValueType[0]->getBuiltinType()) { |
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.
the argument of count() can never be null? (same below)
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.
This method has been introduced insymfony/property-info: 5.3 and the method is typehinted to return an array.
| publicfunctiongetCollectionValueTypes():array |
fabpot commentedJun 2, 2021
Thank you@jderusse. |
…etCollectionValueTypes" (jderusse)This PR was merged into the 5.3 branch.Discussion----------[Serializer][Validator] Fix not null return from "getCollectionValueTypes"| Q | A| ------------- | ---| Branch? | 5.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Currently experimenting `An exception has been thrown during the rendering of a template ("Notice: Undefined offset: 0").`When a property is an array and PropertyInfo is not able to guess the type of CollectionValueCommits-------c4dcfd1 Fix not null return from "getCollectionValueTypes"
Currently experimenting
An exception has been thrown during the rendering of a template ("Notice: Undefined offset: 0").When a property is an array and PropertyInfo is not able to guess the type of CollectionValue