Skip to content

Interfaces or "final traits"? #50

Closed

Description

@ro0NL

From phpstan/phpstan#789 we cant really solve the trait convention, technically nor with phpdoc.

Technically we should ship a CanBeEnabled trait with CanBeEnabledInterface or so to enforce API. Which is plain tedious to do for many trait features, and perhaps even defeats the " low development time overhead" promise.. (i prefer 10 traits over 10 traits + 10 interfaces).

Although technically the "right" thing to do, im leaning to mark these traits @final, meaning you shouldnt mess with them 😁 just use. And ignore related errors from phpstan to move forward.

Given Class&Trait is not a real thing yet, we could stick with @var Class|Trait which today is happily resolved by phpstorm (both clickable, both autocompleted). Thus the least hassle.. only phpstan ignore rule.

Thoughts? Otherwise @final it is :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions