Say I have a function that returns an object of type SomeClass. And I have code like this:
$test = function_to_return_someclass();
Now I want to use the $ test variable in the IDE, but I want it to understand that $ test is of type SomeClass. I can do this easily with class variables using / ** @var * / comment, but this is where I am stuck. And so, having tried something like:
$test = (SomeClass)function_to_return_someclass();
doesn't work, how can I instruct the IDE that $ test is a SomeClass object?
source share