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 #42959 [DependencyInjection] Make auto-aliases private by default (nicolas-grekas)
This PR was merged into the 5.4 branch.
Discussion
----------
[DependencyInjection] Make auto-aliases private by default
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | -
Replaces #41209
Before, this creates a public autoalias:
```yaml
app.lock:
tags:
- { name: auto_alias, format: "app.%database_type%_lock" }
```
After, this creates a public autoalias:
```yaml
app.lock:
public: true
tags:
- { name: auto_alias, format: "app.%database_type%_lock" }
```
Omitting `public: true` will trigger a deprecation warning when the alias is accessed from `$container->get()`. In 6.0, the alias will be private by default if `public: true` is not set.
Commits
-------
679f25eace [DependencyInjection] Make auto-aliases private by default
$target->setDeprecated('symfony/dependency-injection', '5.4', 'Accessing the "%alias_id%" service directly from the container is deprecated, use dependency injection instead.');
0 commit comments