Skip to content

Impossible to override properties from trait #1216

@ossinkine

Description

@ossinkine

Summary of a problem or a feature request

It seems it impossible to override trait property type.
If I add a docblock tag @property to the class to override an abstract class property all work fine.
But if I try to override a trait property PHPStan gets type from the trait and ignores the docblock tag even if the trait property is untyped.
See the reproducer.

Code snippet that reproduces the problem

https://phpstan.org/r/ed69b569c689116346f2d3ffac348577

Expected output

PHPStan gets type from docblock tag @property

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