Auto completion for classes with dynamic methods

I'm working with Yii2 and the content management system Craft CMS (built on Yii2).  The Yii2 framework has a concept called 'behaviors' which, in short, attaches a class (ex: ClothingBehavior to a parent class (ex: User); giving you access to all the methods of the ClothingBehavior on the User class. 

1) the iDE doesn't know that these behavior methods should be available via auto completion on the User class.

2) The User class, for example is a third party package and adding doc block syntax to it is not possible.

I'm trying to explore ways that I could explicitly tell PhPStorm that the User class should have certain methods and properties.

0
2 comments

Would using @mixin on the child class cover this case for you? http://prntscr.com/n7alcm

0
Avatar
Permanently deleted user

@mixin is one part of the problem.  However in #2 above, the @mixin needs to be applied to a third party (composer driven) class that I don't have access to modifying. 

0

Please sign in to leave a comment.