Skip to content

How to deal with 3rd-party annotations as a library author? #308

@mnapoli

Description

@mnapoli

Apologies if that has already been discussed.

In the php-enum project we recently added Psalm annotations (myclabs/php-enum#111). For example @template T for generics support.

Users are now reporting Doctrine Annotations errors:

The annotation "@template" in class MyCLabs\Enum\Enum was never imported. Did you maybe forget to add a "use" statement for this annotation?

(see myclabs/php-enum#113)

Years ago I had that problem as a user, and manually disabled that error in Doctrine Annotation via configuration.

However, as a library author, what can I do to avoid impacting users? Right now I feel like I am breaking users applications by simply adding a comment, it doesn't feel good :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions