Skip to content

Define same property inspection doesn't work as expected in classes PhpDoc #1742

Closed
@algorhythm

Description

Here we can see the Inspection in a special context. A class uses a trait, inside the trait is a property that type is an Object of class A. Class B extends A and added a method. If I'm sure in my context that my Property from Trait only contains Objects of type B, how can I tell the IDE to know this?

Bildschirmfoto 2021-06-18 um 12 35 00
Bildschirmfoto 2021-06-18 um 12 35 39

Above are two tries, first we add the property again with another type. That results in this inspection. But when I define @property B property in classes PhpDoc, I don't expect the Inspection there, because the property is not physically in that class. It's just documented to habe another type, isn't it?

Without both solutions I cannot use code completion here:
Bildschirmfoto 2021-06-18 um 12 36 37

Here is the rest of the used code:
Bildschirmfoto 2021-06-18 um 12 36 47
Bildschirmfoto 2021-06-18 um 12 36 54
Bildschirmfoto 2021-06-18 um 12 37 00

Maybe the issue is similar to this one: #1232

Activity

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

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions