Registry::get('object') autocomplete


$object = Registry::get('object');


* @var MyObject $object



in this way - autocomplete works perfectly because we're saying (using phpdoc) that $object is instance of MyObject.

Is it possible to make PhpStorm autocomplete Registry::get('object')->autocompleted_method()  ?
Maybe it is possible to set some settings helping phpStorm recognize that Registry::get('object') will always return MyObject?

Where can I read about autocomplete tricks in phpStorm?

Thank you!


Hi Kirill,

No, it is not possible to achieve such thing with PHPDoc comment only -- there has to be some help from the actual IDE or plugin (which will analyze the calling params and make decision on returned type based on additionally provided info/resolution tables).

You will be interested in watching this ticket: