Recognizing Class Follow
Lets say a Method returns an array of objects(instances) from class A. Now when i access an element of that array, is there a way to tell PHP/PhpStorm its an instance of class A, so i can use intellisense
$array = someClass->getArrayofObjects
foreach ($array as $element)
{
echo element->getName() //no intellisense
}
Please sign in to leave a comment.
Hi there,
Use PHPDoc comments, e.g.
or
or even better -- add proper doc for that actual method, e.g.
thanks - proper phpdoc works for me ;)