When using factory-like patterns, PhpStorm only recognises classes when docblock comment is used. Example:
/** @var \Some\Thing $thing */
$thing = $this->factory('some/thing');
$thing->doSomething();
Without the @var
declaration, PhpStorm doesn't know doSomething()
is a method of the \Some\Thing
class. If it were entirely up to me, I would just add these docblock comments. However, my coworkers dislike inline docblock comments.
Is there a way to either:
- Ignore these docblocks when committing (eg filter by regex) or
- Teach phpstorm how to find the class name based on the 'some/thing' argument or
- Use another method to keep these comments only in my own working copy?