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

[Validator] fix access to uninitialized property when getting value#35532

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:3.4fromgreedyivan:bugfix_35454_34
Jan 31, 2020
Merged

[Validator] fix access to uninitialized property when getting value#35532

fabpot merged 1 commit intosymfony:3.4fromgreedyivan:bugfix_35454_34
Jan 31, 2020

Conversation

@greedyivan
Copy link
Contributor

QA
Branch?3.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#35454
LicenseMIT
Doc PR

In PHP 7.4, the type-hinted property isuninitialized by default. So it needs to be checked before use.

zmitic reacted with thumbs up emoji
@greedyivangreedyivan changed the titlefix access to uninitialized property when getting value[Validator] fix access to uninitialized property when getting valueJan 30, 2020
@xabbuhxabbuh added this to the3.4 milestoneJan 31, 2020
@fabpot
Copy link
Member

Thank you@greedyivan.

fabpot added a commit that referenced this pull requestJan 31, 2020
…ing value (greedyivan)This PR was squashed before being merged into the 3.4 branch (closes#35532).Discussion----------[Validator] fix access to uninitialized property when getting value| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix#35454| License       | MIT| Doc PR        |In PHP 7.4, the type-hinted property is [uninitialized](https://wiki.php.net/rfc/typed_properties_v2#uninitialized_and_unset_properties) by default. So it needs to be checked before use.Commits-------1edecf7 [Validator] fix access to uninitialized property when getting value
@fabpotfabpot merged commit1edecf7 intosymfony:3.4Jan 31, 2020
@greedyivangreedyivan deleted the bugfix_35454_34 branchJanuary 31, 2020 09:00
This was referencedJan 31, 2020
@fabpotfabpot mentioned this pull requestFeb 29, 2020
@realjjaveweb
Copy link

@nicolas-grekas Hi, would you mind please documenting this also here:
https://symfony.com/doc/current/reference/constraints/NotNull.html or maybe on some generic constraints/validator level?

Because there's not name of Constraint that would imply check for uninitialized property, so people often times just use
#[Assert\NotNull] (Assert =\Symfony\Component\Validator\Constraints).

Which is completely fine since this commit/MR merged but it's not documented anywhere - or at least I didn't find it anywhere in the docs.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

6 participants

@greedyivan@fabpot@realjjaveweb@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp