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

[DI] use filter_var() instead of XmlUtils::phpize() in EnvVarProcessor#29042

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:masterfromnicolas-grekas:env-filter
Nov 2, 2018

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

#29041 made me realize that we don't need this dependency on the Config component:filter_var() is just fine. This allows using a few more legit values for boolean styles, which are already accepted in php.ini

ro0NL, deguif, and Koc reacted with hooray emoji

if ('bool' ===$prefix) {
return (bool)self::phpize($env);
return (bool)(filter_var($env,FILTER_VALIDATE_BOOLEAN) ?:filter_var($env,FILTER_VALIDATE_INT) ?:filter_var($env,FILTER_VALIDATE_FLOAT));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

why allow ints or floats to be casted as bool, and not limit to bools only ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Because that's supported+tested today, and we shouldn't break BC.

@fabpot
Copy link
Member

merging into master as this is not a bug.

@fabpotfabpot changed the base branch from3.4 tomasterNovember 2, 2018 07:26
@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commitce53261 intosymfony:masterNov 2, 2018
fabpot added a commit that referenced this pull requestNov 2, 2018
… EnvVarProcessor (nicolas-grekas)This PR was submitted for the 3.4 branch but it was merged into the 4.2-dev branch instead (closes#29042).Discussion----------[DI] use filter_var() instead of XmlUtils::phpize() in EnvVarProcessor| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -#29041 made me realize that we don't need this dependency on the Config component: `filter_var()` is just fine. This allows using a few more legit values for boolean styles, which are already accepted in php.iniCommits-------ce53261 [DI] use filter_var() instead of XmlUtils::phpize() in EnvVarProcessor
This was referencedNov 3, 2018
@nicolas-grekasnicolas-grekas deleted the env-filter branchNovember 6, 2018 17:20
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@dunglasdunglasdunglas approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

+1 more reviewer

@TaluuTaluuTaluu approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

6 participants

@nicolas-grekas@fabpot@dunglas@javiereguiluz@Taluu@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp