Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[RFC][DependencyInjection] Deprecate the “@required” annotation #48909

Copy link
Copy link
Closed
@alexislefebvre

Description

@alexislefebvre
Issue body actions

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:

/** @inheritdoc*/ // <- brackets are missing on purpose

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:

Example

- /**
-  @required
- /
+ #[\Symfony\Contracts\Service\Attribute\Required]

Metadata

Metadata

Assignees

No one assigned

    Labels

    DependencyInjectionRFCRFC = 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)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.