Telling PhpStorm where a class is located so it can use autocomplete

156 Views Asked by At

I'm using WordPress and using a plugin called Timber, which basically helps you to utilise the Twig templating engine in WordPress.

Anyway, I am trying to do this in one of my files:

Timber::render('welcome.twig');

PhpStorm is reporting that Timber is an unrecognized class, because it doesn't see where I have included it; I assume it is being auto-loaded somewhere?

Now, I did a search around and came across answers about using PHPDoc such as this, however I'm not sure how to apply that to my situation, I tried:

/** @var \Timber\Timber */

...but it didn't seem to work.

If I can somehow do this globally that would be great, so I don't have to do it in every file I need to use Timber in.

0

There are 0 best solutions below