Does anyone know if PHPStorm has some builtin support for view helper autocompletion or a possibility to write a plugin for it. I don't want to use inline var definitions for this as this would be cumbersome to do if I use a lot of view helpers
$this->inlineScript()-> //I want some autocomplete here.
$this->translate('some translation')-> //Please give me autocompletion
If I use var definitions it will end up as something like this, but it will really clutter up 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
inlineScript()
and/ortranslate()
are declared? Maybe they simply do not have appropriate PHPDocs ? – Aftercare__call
method :) – Barto/* @var $this \Zend\View\Renderer\PhpRenderer */
. That could potentially work – Overarch$this
as a "fake" class that extends thePhpRenderer
and has the additional hints. – Overarch@method
PHPDOc comment for that class? P.S. Complete side note: proper PHPDoc syntax is/** @var [type] [varname] */
and not/* @var [varname] [type] */
(notice the order and double star) -- both variants work in PhpStorm, but "proper" one is the first. – Aftercare@method
is indeed the way to go. The file ocramius referred to did it the same way. Thanks for the feedback for the proper syntax, I'm using the first variant mostly I think. – Barto