Closed
Description
Description
Symfony (including 6.2) supports the @required
annotation, see for example with Symfony 5.4: https://symfony.com/doc/5.4/service_container/autowiring.html
Tests have to cover a wide range of different cases:
The proposal is to deprecate the @required
annotation and suggest to replace it with Symfony\Contracts\Service\Attribute\Required
.
This would simplify the codebase of Symfony at the next major release and encourage users to migrate from annotations to attributes.
See also:
- [DependencyInjection] 6.0 [autowiring] remove mention to @required symfony-docs#17654
- [DependencyInjection] 6.0 [injection_types] remove mention of @required in service_container symfony-docs#17655
- [FrameworkBundle] remove double required annotation + attribute #48874
Example
- /**
- @required
- /
+ #[\Symfony\Contracts\Service\Attribute\Required]
Metadata
Metadata
Assignees
Labels
RFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)