Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:5.3fromjderusse:fix-propertyinfo-array
Jun 2, 2021

Conversation

@jderusse
Copy link
Member

QA
Branch?5.3
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

Currently experimentingAn 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

@jderussejderusseforce-pushed thefix-propertyinfo-array branch fromc428704 toc4dcfd1CompareMay 31, 2021 12:40
@jderussejderusse added this to the5.3 milestoneMay 31, 2021
@carsonbotcarsonbot changed the titleFix not null return from "getCollectionValueTypes"[Serializer][Validator] Fix not null return from "getCollectionValueTypes"May 31, 2021
[$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()) {

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)

Copy link
MemberAuthor

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
Copy link
Member

Thank you@jderusse.

@fabpotfabpot merged commitf8e021a intosymfony:5.3Jun 2, 2021
@fabpotfabpot mentioned this pull requestJun 2, 2021
hultberg pushed a commit to hultberg/symfony that referenced this pull requestSep 17, 2021
…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"
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dunglasdunglasdunglas approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.3

Development

Successfully merging this pull request may close these issues.

5 participants

@jderusse@fabpot@dunglas@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp