PhpStorm doesn't knows about methods/variables in my code

Perhaps I misunderstood how PhpStorm works, I never worked with an IDE before.

I created a new project, put in all my code and opened some files. There are many error/info messages telling me methods not found, variable not defined, and more. 

The code itself is correct and works fine (locally and an the web server). However, I thought PhpStorm (magically) knows where the methods are defined, knows about the parameters, sees where variables are created in other file and so on. Was this a misassumption? 

Do I need to configure something to get this work correctly or change my code accordingly?

Project is a CMS and I am working inside /site-xxxx/templates/ and /site-xxxx/modules/

Comment actions Permalink

PhpStorm requires php objects to be located inside a project or added as "include paths".

Could you please provide an example of a missing class (one that PhpStorm is unable to find) that you know does exist & you can locate it using PhpStorm?

Comment actions Permalink

Thanks for the quick help!

The class/object is from within my project. As an example I have copied this repo: and opened the file

Please have a look at screenshot #1

And this one is an example from my project.

Comment actions Permalink

I believe this could be helpful here: (f.e., the advice with adding variable type hints in DocBlock)

Also, if you are using ProcessWire, this one could be a good thread to vote for:

Comment actions Permalink

Thanks for the two links 


Please sign in to leave a comment.