Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #31306 [DI] Improve exception message on missing $ of named arg…
…ument (jschaedl) This PR was squashed before being merged into the 4.3-dev branch (closes #31306). Discussion ---------- [DI] Improve exception message on missing $ of named argument | Q | A | ------------- | --- | Branch? | master | Bug fix? | - | New feature? | - | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #31265 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | not related <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> ### Description As described in #31265, missing the prefix `$` in an argument name: ``` App\Word\WordChecker: arguments: checkers: - '@app\Word\Checker\StaticWordChecker' - '@app\Word\Checker\BannedWorldListChecker' ``` led to the following error: `Invalid service "App\Word\WordChecker": the value of argument "checkers" of method "__construct()" must be null, an instance of Symfony\Component\DependencyInjection\Reference or an instance of Symfony\Component\DependencyInjection\Definition, array given.` As this error message is quite confusing I changed it to: `Invalid service "App\Word\WordChecker": Did you forget to add the "$" prefix to argument checkers` ### Todo - [x] add a unit test Commits ------- d0e4499 [DI] Improve exception message on missing $ of named argument
- Loading branch information