Please sign in to comment.
feature #22185 [DI] Enhance DX by throwing instead of triggering a de…
…precation notice (nicolas-grekas) This PR was merged into the 3.3-dev branch. Discussion ---------- [DI] Enhance DX by throwing instead of triggering a deprecation notice | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | yes - at the config file level, for edge cases | Deprecations? | no | Tests pass? | yes | Fixed tickets | #22143 | License | MIT | Doc PR | - Looking at the linked issue, I'm reconsidering our decision to trigger a deprecation notice when one uses `_instanceof` or `_defaults` as a service name. While on the BC side, this is strict - on the DX side, it looks like this opens a trap where people fill fall into. The same occurs to me with named args: instead of silently accepting invalid args as was the case before, let's throw to help DX when people do mistakes. Last change in this PR: the complex logic required to force strings to be given as `$id` args into `Reference` or `Alias` makes no sense to me, especially considering that a `string` type hint on PHP7 will *do* a string cast. Commits ------- b07da3d [DI] Enhance DX by throwing instead of triggering a deprecation notice
- Loading branch information...
Showing with 31 additions and 50 deletions.
- +6 −0 UPGRADE-3.3.md
- +6 −0 UPGRADE-4.0.md
- +1 −6 src/Symfony/Component/DependencyInjection/Alias.php
- +4 −4 src/Symfony/Component/DependencyInjection/Compiler/ResolveNamedArgumentsPass.php
- +0 −2 src/Symfony/Component/DependencyInjection/Container.php
- +13 −20 src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
- +1 −6 src/Symfony/Component/DependencyInjection/Reference.php
- +0 −12 src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php