Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #24491 [DI] Exclude inline services declared in XML from autowiri…
…ng candidates (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [DI] Exclude inline services declared in XML from autowiring candidates | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24311 | License | MIT | Doc PR | - As reported in #24311, inline services should not be candidates for autowiring. This PR fixes the issue, but is submitted against 3.4 because there is a potential BC break here, for ppl that didn't realize they relied on this (already deprecated) behavior. We *could* not merge this PR and consider the deprecation is fine - but in practice, the WTF is hitting several ppl already AFAIK, so we should close that door IMHO. Commits ------- d90e721 [DI] Exclude inline services declared in XML from autowiring candidates
- Loading branch information
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...ymfony/Component/DependencyInjection/Tests/Fixtures/xml/services_inline_not_candidate.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
<services> | ||
<service id="foo" class="stdClass"> | ||
<argument type="service"> | ||
<service class="Symfony\Component\DependencyInjection\Tests\Compiler\D"/> | ||
</argument> | ||
</service> | ||
<service id="autowired" class="Symfony\Component\DependencyInjection\Tests\Compiler\E" autowire="true"/> | ||
</services> | ||
</container> |