Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #22991 [DI] Don't throw Autowire exception for removed service wi…
…th private __construct (weaverryan) This PR was merged into the 3.3 branch. Discussion ---------- [DI] Don't throw Autowire exception for removed service with private __construct | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none (was talking to a user) | License | MIT | Doc PR | n/a Suppose you have: ```php class A { private function construct() {} } ``` This service will fail to be autowired. But, like other autowiring failures, if this service will ultimately be removed from the container, this exception should be ignored. This fixes that. Unless someone is using the `AutowirePass` directly inside a `try/catch`, there is no BC break (the behavior change is that the exception is now stored, instead of being thrown). This also clarifies (in the test & phpdoc) that `AutowirePass` always throws `AutowiringFailedException`s. Thanks! Commits ------- 2d3e44e Fixing a bug where an autowiring exception was thrown even when that service was removed
- Loading branch information
Showing
3 changed files
with
44 additions
and
17 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