In PhpStorm, if I create an object, then I have all auto complete on that object working fine:
$object = new MyClass();
$object->getNa...
Will auto complete to
$object->getName();
So far so good, but if I get returned an object through the first method, then the auto complete will not work on that.
$car->getDriver()->getNam...
Will show an empty list. The getDriver method has its PHPDoc @return tag set to 'Driver' though and in some other IDEs, this therefore works to get the correct auto complete.
Wondering if there's a setting that I missed somewhere or if PhpStorm doesn't offer this kind of advanced auto complete yet?
$object
, which is explicitly assigned an instance ofMyClass
, but in your second example, you are working with$car
, which we do not see the initialization for. Perhaps the problem here is not that PhpStorm doesn't know the return value ofgetDriver()
, but that it doesn't know the type of$car
. – Mustard