You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #48147 [DependencyInjection] Add env and param parameters for Autowire attribute (alexndlm)
This PR was squashed before being merged into the 6.3 branch.
Discussion
----------
[DependencyInjection] Add `env` and `param` parameters for Autowire attribute
| Q | A
| ------------- | ---
| Branch? | 6.3
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
These parameters will help not to miss `%` when auto-wiring the env variable or parameter.
Commits
-------
ed94fdc [DependencyInjection] Add `env` and `param` parameters for Autowire attribute
thrownewLogicException('#[Autowire] attribute must declare exactly one of $service, $expression, $env, $param or $value.');
42
46
}
43
47
44
48
if (\is_string($value) && str_starts_with($value, '@')) {
@@ -52,6 +56,8 @@ public function __construct(
52
56
$this->value = match (true) {
53
57
null !== $service => newReference($service),
54
58
null !== $expression => class_exists(Expression::class) ? newExpression($expression) : thrownewLogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".'),
0 commit comments