'Php, code competion for inline-factory / dynamic method name?
given this snippet:
class Test
{
public function run2()
{
}
}
class Factory
{
public function createTest()
{
return new Test();
}
}
$factory = new Factory();
$m = 'createTest';
$factory->{$m}->run2();
Phpstorm will say most of it are unused:
of course I can extract the calls:
$factory = new Factory();
$m = 'createTest';
$x = $factory->{$m}();
/** @var $x Test */
$x->run2();
that way at least run2() is shown:
is there a "magic" phpdoc which Im not aware of? I dont want to extract method calls.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


