I know I can use PhpStorm annotations like this:
/**
* Class Model
* @property string name
*/
class Model {};
$modelInstance = new Model();
$modelInstance->name;
When I type $modelInstance->
PhpStorm will offer me "name" in autocomplete.
Is it possible to create custom property annotations for instances of classes?
/**
* Class Model
* @property string name
*/
class Model {};
/**
* @var Model $modelInstance @property text
*/
$modelInstance = new Model();
$modelInstance->text; //PhpStorm does not know about this property
I would like to have property "text" in PhpStorm autocomplete but ONLY for $modelInstance
. Not for every instance of class Model.