Method not found in the class?....Sometimes.....
Am new to PHPStorm, still learning it.
I am getting Method not found in the subject class, in some files but in others it works fine
$myObj = new Class_List_Image_Groups(TRUE, FALSE, 55);
$myObj->getAll(FALSE, 1);
So when I place mouse over Class_List_Image_Groups if finds Class
but when I place mouse over getAll it does not find Method
Now the above problem only happens in some files.... My code is working..
I already tried "invalida cache/restart"
Please sign in to leave a comment.
What are Common Fixes? What are common Causes for this error?
Is it code related? Does it not like very big files?
I had this 6000 line file, and I Commented out the whole file and then started uncommenting small sections at a time. One moment the "Method not found in the class" message would go away and then return,
The act of adding this one line of code
I still have no idea how to solve it:_|
Hi there,
1) What is your PhpStorm version?
2) Can you share this large file (attach to the post)?
If invaliding caches did not helped ... then I may only suggest to disable all 3rd party (non bundled) plugins and see how it will behave this way.
In any case: please provide your idea.log (Help | Show Log in ...) -- it may have additional details.
Sorry am a bit slow, am somewhat new to PHP, phpStorm8... 4 years but never had a job on it...mostly as a hobby
Am a Cobol Programmer....Very different from php
Am on the latest version of PhpStorm8 (8.0.2), Got it about 2weeks ago, Platform is Windows8.1(about 3 weeks old), rebuild my PC after it died
So am running everything on my localhost, am using XAMPP, apache2.4, php5, mySQL
Just deleted all my logs, figure I start from scratch... did a Invalidate cache/restart, and open my phpStorm Project to see if error still there
Ok I think I got the log files u requested, also attached a small snapshot of the screen with error and without,
to make the error go away i just truncated the file over and over till the error goes away, till a point where if I add "$a =5;" the error reappears
Thanks for looking:), 3am, time for bed soon
Attachment(s):
idea.log.zip
threadDump-20150107-021935.txt.zip
screenshot2.png
screenshot.png
Unfortunately I'm unable to make anything out of this info.
I may only suggest:
1) See if temporarily going back to 8.0.1 (or trying 8.0.3 EAP build) will resolve the issue. There was some unexpected issue in 8.0.2 (WI-25857, WI-25865) where IDE is having issues with analysing deeply nested function/metod calls -- maybe it's related.
2) Submit a ticket with all this info (thread dumps, logs, source file (you can make it visible to "idea-developers" only) to the Issue Tracker.
Thanks anyways, I am still playing with my code, Clean the hell out of it just to see if it's my fault, simplified ... am new to php after all
I might get lucky
At the moment I am looking at..hmm example:
When I am not getting the method not defined error. I noticed that sometimes when i place the crtl+mouse-hover over the object name I get a SINGLE Class name for that object, BUT sometimes I get ALL the class names(multiple implementations)... again, Sometimes only
I have a feeling it is because I am creating too many objects, my Script works fine, I am just curious as to why i get "Method not found in the class". Might just tryin to break this big file into smaller ones
Anyways, thanks for trying Andriy
I got a bug in PHPStorm Build #PS-232.10072.32, built on October 13, 2023 : cannot find method usages within the same class.
Namely:
I click on $this->findRecords($ad); and am successfully redirected to method declaration.
but when I click Alt + F7 (find usage) on the declaration protected function findRecords() – no uses are found, despite that fact that I landed from there just now.
What Helped me (solution):
* click Alt + F7 (find usage) on the method declaration
* see bubble message that no usage are found (it is bug but it has settings icon-gear)
* click on gear and configure
** Activate checkbox on ‘Text Occurrences’
** Change scope to ‘All files’ (not only project files)
Eugen Kaurov Hi! Do you still have a reproducible code sample that you think you may share?