Cakephp and undefined methods

I'm checking PHPStorm 1.02 to replace Eclipse and so far I like it, but apparently the editor has a little problem with Cakephps structure?

Asumming a simple Controller, I try to use the set method to set a variable for my view, like so:

class FoosController extends AppController {
     var $name = "Foos";

     function index() {
          $this->set('something', 'something else');

Now the editor warns me for "set" that the referenced method is not found in the subject class.

Well, as we see FoosController extends AppController which in turn extends Controller which indeed does have a public method called set.
Why does PHPStorm not find this method? The hierarchy should be obvious?!

If you think that problem is not specific to Cakephp but is general php support problem - file a new bug report.


I did a few tests and apparently the problem is that Cakephp has several files that create the same class.
For example Cakephp uses the same Classname for the basic classes but also for their basic class tests.
Another example - Cakephp brings it's own "AppController" Class which can be overlayed by a users "AppController" Class.

PHPstorm seems to be at a loss wich of those files is the correct one and thus does not get the correct hierarchy. Is there a way via PHPdoc to tell PHPStorm "This is the file that represents the actual parent class"? Or otherwise, to exclude certain directorys from the flow, so that it would not look inside the testing folder or the console folder?


Any movement on this topic since the last post?  Does PhpStorm 2.1 bring anything new to this scenerio?  (ie. CakePHP compatability)


Only easier ways to exclude "duplicate classes" from project. ("mark as plain text" in file contet menus)
We do not work anything Cakephp specific now and general solution on this problem is not yet available. Watch WI-2760


Please sign in to leave a comment.