-
-
Notifications
You must be signed in to change notification settings - Fork 934
Description
I use PHPStan version dev-master@07601ea.
I have a ListModuleVersionsController class that uses a trait IsListControllerTrait. That trait has private property $repository therefore I don't need to define $repository in ListModuleVersionsController.
I inject AbstractModuleRepository in constructor of ListModuleVersionsControler and assign it to $repository property. Since $repository property is defined in a trait as having the type of PaginableRepositoryInterface, PHPStan interprets type of $repository property in context of ListModuleVersionsController as being of type PaginableRepositoryInterface. It produces false positive errors e.g. methods missing due to wrong type detection of $repository property in ListModuleVersionsController.
Wouldn't it be great if PHPStan was able to correctly determine the type of class' property when it's defined only in a trait and re-assigned in class' constructor?