Skip to content

ServiceSubscriberTrait - Should use Required attribute for setContainer instead of annotation #45679

@AndreasA

Description

@AndreasA

Symfony version(s) affected

5.4-6.1

Description

Not that important a bug, but the ServiceSubscriberTrait only works in combintation with PHP8.0 attributes, so using the old @required annotation is a bit weird, instead the #[Required] attribute should be used.

How to reproduce

See https://github.com/symfony/symfony/blob/v5.4.6/src/Symfony/Contracts/Service/ServiceSubscriberTrait.php#L101

Possible Solution

Use attribute instead

Additional Context

Not really an issue but also not a feature request. not sure what I should have selected instead. Personally, I thought bug was the best choice.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions