PHP - Autocomplete for magic method that receives the returning class as argument

Viewed 179

Having:

$ApiTokenService = Loader::get("App\\Services\\ApiTokenService");

How do I document get() method to let it know that first param would be the returning output type? So whenever i start typing $ApiTokenService->cr.. i get create method suggest that ApiTokenService has.

I'm using PhpStorm as IDE. I've tried things like

 /**
 * @param string $classPath
 * @return {$classPath}
 */

But nothing has worked so far.

And PHPStorm metadata file:

<?php
    namespace PHPSTORM_META {
        override(\Loader::get(), type(0));
    }
0 Answers
Related