Skip to content

Support for @phpstan-property on class definitions. #6040

@mad-briller

Description

@mad-briller

Feature request

PHPStan supports several @phpstan- prefixed annotations to allow developers to make use of the stricter types phpstan offers, that other tools may not recognize.

However, this does not extend to the @property annotation, meaning that we are stuck using typical types in property annotations for classes. It would be great if we could do something like this for example:

 * @property non-empty-string $cancellationMethod
 * @phpstan-property CancelMethod::METHOD_* $cancellationMethod

Thanks for the great work on PHPStan, incorporating it into our pipelines stack has been great and caught several issues early!

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