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

[DependencyInjection] Deprecate numeric parameter names#47683

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

Conversation

@HeahDude
Copy link
Contributor

@HeahDudeHeahDude commentedSep 24, 2022
edited
Loading

QA
Branch?6.2
Bug fix?no
New feature?no
Deprecations?yes
Tickets~
LicenseMIT
Doc PRTODO

While trying to use'.' !== $key[0] instead ofstr_starts_with($key, '.') in#47680, I noticed some tests were failing due to the usage of numeric parameter names in the fixtures.

This leads to inconsistent behavior since the following code:$parameterBag->set(10, 10), will first cast the name10 to string because of the method signature, but will then cast back to integer when using it as an array key inhttps://github.com/symfony/symfony/blob/6.2/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php#L89.
Because Symfony does not use strict types, it can be really tricky.

This PR propose to deprecate using such names to be able to properly throw in 7.0.

@carsonbotcarsonbot added this to the6.2 milestoneSep 24, 2022
@HeahDudeHeahDudeforce-pushed thedeprecate/numeric-parameter-names branch 2 times, most recently fromf47f3bd to8083245CompareSeptember 24, 2022 18:59
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

LGMT, just some minor comment

@HeahDudeHeahDudeforce-pushed thedeprecate/numeric-parameter-names branch 2 times, most recently fromd3af9e4 toe391711CompareSeptember 26, 2022 11:51
@HeahDudeHeahDudeforce-pushed thedeprecate/numeric-parameter-names branch frome391711 to3e0050aCompareSeptember 26, 2022 13:23
@chalasr
Copy link
Member

Thank you@HeahDude.

@chalasrchalasr merged commit59da7ea intosymfony:6.2Sep 26, 2022
@HeahDudeHeahDude deleted the deprecate/numeric-parameter-names branchSeptember 26, 2022 14:18
@fabpotfabpot mentioned this pull requestOct 24, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

4 participants

@HeahDude@chalasr@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp