I have the following code in an application powered by Silex:
$uknownObj->unkownRef
$uknownObj being a dependency injection container.
I know that unkownRef is of instance MyCoolObj.
Now how can I tell IntelliJ / PhpStorm to actually help me with autocomplete of this said object?
Simply assign unkownRef to a variable and provide annotation like this.
/** @var MyCoolObj $obj */
$obj = $uknownObj->unkownRef;
You can either use phpdoc comments as suggested by xmoex, or assert type with instanceof:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With