2 classes with same name |
Guru master
|
I understand your problem and it is great the NetBeans asks you which file, but without using namespaces, having two or more classes of the same name just doesn't sound like a good idea to me. I wouldn't accept that situation in any of my projects.
If both those classes tried to load at the same time, you should get a PHP run-time error. Could you rename one of the classes? In the PhpED Code Completion settings you could try ticking Limit scope to includes but if both of those Foo classes are included then that won't work. Alternatively, if PhpED is quite simply detecting the wrong include file for a class, you might be able to tell PhpED to use a specific copy of that class. Go into Project Properties, click Includes and see if there is an incorrectly resolved include statement in that list, then on the right side change the resolved file name to the one that contains the correct class. |
||||||||||||
|
|
I'm dealing with the same situation, but it's somebody else's code I'm reading and frankly, there's no obvious better way to do it. The class that PHPEd is finding is placed inside an "if(!class_exists(...))" by a plugin, most likely as a compatibility fix; in fact that compatibility fix is not needed on my particular setup, but I'd rather not remove a compatibility fix just to please my IDE. This framework handles file includes dynamically, so PHPEd isn't going to tell the difference between an included file and a non-included file. Adding something to the phpdoc would be an acceptable solution, since I'm mainly interested in how the new code that I'm writing calls that class, but I think Netbeans has the best solution. In my specific case, I handled the problem by renaming the class that was being incorrectly found, re-running the "find declaration" call, and finally naming it back. That at least allowed me to find the important class in the other guy's code. Perhaps that workaround will help you, nezdalida. |
||||||||||||||
|
2 classes with same name |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by