如何记录ZF1帮助程序以在IDE中获得自动完成功能

I'm working with ZF1 and we have helpers in the project. By default IDE doesn't understand which class will be returned in that expression:

$this->getHelper('CRM')->getModeDependantLink($url);

So the system doesn't what will be returned by $this->getHelper('CRM') and can't find the method getModeDependantLink()

I can write this code in two lines to achieve the goal:

/** @var Lead_Helper_CRM $helperCRM */
$helperCRM = $this->getHelper('CRM');
$helperCRM->getModeDependantLink($url);

The PHPDoc explains to the IDE that $this->getHelper('CRM') returns object of Lead_Helper_CRM and then IDE knows everything about method getModeDependantLink()

But I don't like 2 lines of code. I'd like to get the same, but for one line code, something like:

/** @class Lead_Helper_CRM $this->getHelper('CRM') */
$this->getHelper('CRM')->getModeDependantLink($url);

Could please someone tell me if it possible to do with some PHPDoc trick? If yes, could you please show me a simple rough example how it can be done?

The only possibility might be the @return tag on the getHelper() method.

If it lists all possible returned classes,

and if your IDE knows how to interpret that

(and thus shows all potential methods from all those potential classes)...

That is the only scenario where what you want (method popup against the getHelper()->) might work.