I use __call() magic php method to call non existing method with my own instructions.
I want know how can I indicate to phpstorm : this non-existing method returned an instance of a class?
exemple :
class Baz
{
function __call()
{
return new Bar();
}
function test()
{
$this->foo()->bar();
}
}
class Bar
{
function bar()
{
//do something
}
}
I want declare for all current class Baz :
/** @return foo() Bar */
I want PhpSotrm found the bar() method source and concider foo() like a Bar instance object.
How can I do that?