Autocomplete for ZF2 viewing assistants in PhpStorm

Does anyone know if PHPStorm supports some built-in support for viewing auxiliary autofill or the ability to create a plugin for it. I don't want to use the built-in var definitions for this, as that would be cumbersome if I use a lot of helpers of the kind

$this->inlineScript()-> //I want some autocomplete here.

$this->translate('some translation')-> //Please give me autocompletion

If I use var definitions, it will end up with something like this, but it really clutters my view:

/* @var $inlineScript \Zend\View\Helper\InlineScript */
$inlineScript = $this->inlineScript();
$inlineScript-> //Now I have autocompletion goodness

/* @var $translate \Zend\I18n\View\Helper\Translate */
$translate = $this->translate();
$translate('some translation')-> //Now I have autocompletion goodness
+5
source share
1 answer

NOTE I post my method, discussed in the comments as an answer.

To introduce existing non-existent methods, the syntax is as follows:

/**
 * @method \Zend\Mvc\Controller\Plugin\Url url(string $route = null, array $params = null)
 */
class MyClass
{
}

- url , MyClass:

/* @var $a \MyClass */
$a->// typehint!

"" , :

/* @var $this \MyFakeClass */

$this script. https://github.com/zendframework/zf2 - https://github.com/zendframework/zf2/pull/3438

+11

All Articles