Incorrect Code Error Highlighting
I'm creating a simple class that gets extended:

I'm getting a code highlight error "Undefined class parent" with the super call in the child constructor, which is ridiculous, as it is a reserved keyword and clearly refers to ParentClass. Even if I change it to ParentClass instead of parent, I get the error, "Method '__construct' not found in ParentClass", which is again, ridiculous. Also, I'm getting code highlight errors for inherited fields: "Field 'restPrefix' not found in ParentClass", etc.
There's no PHP error here; it runs just fine. I'm just shocked that PhpStorm can't handle such a simple use case.
What am I doing wrong? How can I write the code to suppress these highlight errors?
Please sign in to leave a comment.
Hi there,
Such stuff works just for for me. Although I had issues when the same line works fine in one file and shows "wrong number of arguments" in another (when calling the same function with the same arguments) -- in one file it recognizes new function signature in another it is not.
In my case simple Cut & Paste back did the job.
See if this will help here.
But in any case: please try "File | Invalidate Caches" and restart IDE (especially if you had an EAP build before or did in-place update). Wait for indexing to finish after restart.