Many undefined constants, variables, methods and fields?
I am currently working on a big project (Joomla, over 8000 files) and I notice that some (not all) constants, methods, fields, etc. are marked with the warning "undefined". I am wondering if this is because the project is so big, or because I forgot some setting or because of something else.
Like I said, many of them don't get a warning, just some (at least a few in each file) and I am certain they are defined. Also I cannot see any difference in the ones that get the warning and those that do not?
Please sign in to leave a comment.
Please provide link to Joomla sources, specific file name and a screenshot.
Also please always note IDE build and OS.
Hello,
i have the same "problem". I think it is the way Joomla loads classes. For example there is no codecompletion for "JRequest..." or "Jfactory...". But after JFactory is used, the object works correctly: when i use $user=& JFactory::getUser(); the $user codecompletion works.
Thomas
phpStorm 2.0 for Mac
You may be right. I dug up two other big projects from my archives to test this. One without CMS but with loads of php scripts/classes/etc. and one with Drupal. I noticed that Drupal has the same probelm as Joomla (although less so) and the other project didn't have the problem (save a few instances). So It probably depends on how the code is written.
I do hope this is something that will be looked into (I never noticed this problem in Eclipse for example) as I am still trying out phpStorm and I love it to bits, but all those false positive warnings really mess up my overview of the code. (disabling the inspector isn't an option as that would also diable the true positives).
I'll just live with it for now and hope for an improvement.
i had a similar issue until recently, i fixed it by going to File > Invalidate Caches.. then let PhpStorm do it's re-indexing and now everything is working as expected