Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Deprecate integer keys in "service_locator" config#48686
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
[DependencyInjection] Deprecate integer keys in "service_locator" config#48686
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| returnnewServiceLocatorArgument(AbstractConfigurator::processValue($values,true)); | ||
| $values = AbstractConfigurator::processValue($values,true); | ||
| if (isset($values[0])) { |
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.
We can usearray_is_list to detect numerically indexed arrays. But for a more complete validation, all key needs to be strings.
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.
I see, it's a bit confusing. It's possible to mix strings and sequential integers and non-sequential integers. The only sequential integers from zero (or undefined keys) are deprecated and will be replaced with IDs.
I will try to improve the messages. However, I could use help.
src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
afac82d to249b26dCompare249b26d to57c2365Comparenicolas-grekas commentedDec 22, 2022
Thank you@upyx. |
…pyx)This PR was squashed before being merged into the 5.4 branch.Discussion----------[DependencyInjection] Remove not implemented behaviorCurrently numeric keys are used, but it will be deprecated and changed in 7.0.Deprecation:symfony/symfony#48686New behavior:symfony/symfony#48653Commits-------a8770de [DependencyInjection] Remove not implemented behavior
Uh oh!
There was an error while loading.Please reload this page.
It deprecates undefined/wrong behaviour ofhttps://symfony.com/doc/current/service_container/service_subscribers_locators.html#defining-a-service-locator