Zend Framework - Code completion not working for Zend classes


I am starting to use Zend Framework and have a quick start project set up and its running/displaying fine in browser.

In PhpStorm though its showing that it does not recognize classes used in the layout files.


<?php echo $this->headLink()->appendStylesheet('/css/mobile.css') ?>

Its saying 'Method "Headlink" not found in subject class'.

Do I need to set up the project in any particular way for this sort of warning to clear when using Zend Framwork?

This is not a particular problem in itself as the code works but I simply would like to have the IDE set up correctly so that the code completion works if this is at all possible.

Attached is a screen shot of the IDE with error.

Many thanks

Screen Shot 2012-07-10 at 7.27.47 AM.png
Comment actions Permalink

Hi John,

You are trying to use $this outside of the actual class. It is obvious that PhpStorm does not know what $this means in this context (some standalone php/html mix file).

The only thing you can do is to tell what $this means. Try adding the following on the very top of such file:

<?php /** @var Your_Class $this */ ?>

or swap class/type and variable name around, e.g.

<?php /** @var $this Your_Class */ ?>

Hopefully this will be somehow improved in future versions:

Comment actions Permalink


Ok, solved this, finally after much reading and fiddling. Issue was with PEAR, not PHPUnit itself.

Found the issue by following the set up for PEAR onhttp://pear.php.net/manual/en/installation.checking.php

php.ini change from




solved this issue immediately.

phpunit --version now works

Comment actions Permalink

Glad that you have worked that out.

Wrong thread. Correct one is here: http://devnet.jetbrains.net/thread/437347


Please sign in to leave a comment.