"Undefined method" for "Defined method"

Hi all,

I have 3 classes defined this way :

abstract class A

abstract class B extends A

final class C extends B



I tried to invalidate cache or without the abstract keywords but I always get in B and C that the methods (and attribute) defined in A are "undefined" and in C that the methods (and attribute) defined in B are "undefined" which puts a lot of red everywhere and is quite boring to work
Any help is welcome

Adrien

3 comments
Comment actions Permalink

Hi Adrien,

Please provide standalone example (for example, the project with only 3 basic classes) so that it can be tested/reproduced on another computer -- as I do have similar class hierarchy (3 abstract classes + 1 "normal") and it works absolutely fine.

It is possible that you have more than one class with the same name in  your project which may cause this sort of errors. Do you use any  framework, which one ?

0
Comment actions Permalink

Your question was the answer!

I did exactly what you asked : Take the three classes and put them in a new project. It works perfectly well. So what happened then?

I use a lot of time the same class names in this project (by design) as different version of code are loaded by different version of some client. There is nothing I can do about this. But I could overcome the problem the following way.

I left an old, unreferenced in the code, version of the same classes in the same directory that I used as a placeholder and temporary backup for my work. The class "old_xml_store.php" being before "xml_store.php" because "o" is before "x", the definition from "old_xml_store.php" was used instead of the one from "xml_store.php" so none of the new definitions were available in the code completion.

Deleting the "old_???.php" files in the same directory solved the issue.

Good to go now, getting a lot faster with autocompletion.

I strongly believe I underuse this great product.

Regards

Adrien

0
Comment actions Permalink

Ensure that only ONE definition for class with any given name exists in project sources (regardless of includes)

0

Please sign in to leave a comment.