8000 [RFC] Deprecate most of or all annotations? · Issue #49369 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[RFC] Deprecate most of or all annotations? #49369
Closed
@alexislefebvre

Description

@alexislefebvre

Description

There is ongoing work about deprecating the usage of annotations:

I didn't see a general discussion about this subject, so I created this issue to rai 5E2F se the question:

Should some or all annotations be deprecated in 6.3 and removed in 7.0?

Attributes are natively supported with Symfony 6.3+, because it requires PHP ≥ 8.1 and attributes were added in PHP 8.0. While annotations require to install doctrine/annotations.

On a side note, PHPUnit 10 allow to use attributes instead of annotations: sebastianbergmann/phpunit#4502

Example

-    /**
-     * @required
-     */
+    #[\Symfony\Contracts\Service\Attribute\Required]
     public function setFoo(Foo $foo)
     {
         // should be called
     }

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = 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

      0