-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[Config][DependencyInjection][Routing] Deprecate using $this or the internal scope of the loader from PHP config files
#61860
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Config][DependencyInjection][Routing] Deprecate using $this or the internal scope of the loader from PHP config files
#61860
Conversation
|
the changelog mentions using the |
|
yeah, I think this is too niche anyway |
$this and its internal scope from PHP config files; use the $loader variable instead
$this and its internal scope from PHP config files; use the $loader variable instead$this or the internal scope of the loader from PHP config files
20ab6a5 to
11fcdb5
Compare
|
PR updated, I figured out a BC layer! |
stof
left a comment
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 suggest adding a test covering this BC layer (as the SecurityBundle functional tests have been migrated to stop using this feature)
src/Symfony/Component/Config/Definition/Loader/DefinitionFileLoader.php
Outdated
Show resolved
Hide resolved
05702a1 to
3ab95d2
Compare
|
Tests added |
… internal scope of the loader from PHP config files
3ab95d2 to
9afb4f4
Compare
…rnal scope from PHP config files (nicolas-grekas) This PR was merged into the 7.4 branch. Discussion ---------- [DependencyInjection] Throw when using `$this` or its internal scope from PHP config files | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | #62547 | License | MIT The BC layer brought by #61860 doesn't work: as described in #62547, the first call to load() has side effects which can break when the second and fallback call is made. I don't see any other way. Well, one would be to operate on a clone, and if that works, rerun with the real container builder. But the overhead is going to be high for everybody. I'm therefor proposing to change this as a BC BREAK. While less than ideal, this happens at compile time, and the fix is trivial and explained in the error message. Commits ------- 7ffcd64 [DependencyInjection] Throw when using `$this` or its internal scope from PHP config files; use the `$loader` variable instead
The target of this change is being able to patch the PHP-DSL examples in the documentation without any downsides: