This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Problem with PHP navigator. Class annotations generate code error hints and method duplicates in navigator. | ||
---|---|---|---|
Product: | php | Reporter: | geo.leu |
Component: | Editor | Assignee: | Ondrej Brejla <obrejla> |
Status: | REOPENED --- | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 8.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Patch |
Description
geo.leu
2014-07-22 11:29:56 UTC
It "is" method redeclaration. You shoudn't use @method annotation if there is a real method declared in a class. @method annotation is just for "magic" methods. This is really wrong: <?php /** * @method void functionName() Description */ class ClassName { function functionName() { } } ?> (In reply to Ondrej Brejla from comment #1) > It "is" method redeclaration. You shoudn't use @method annotation if there > is a real method declared in a class. @method annotation is just for "magic" > methods. > > This is really wrong: > > <?php > /** > * @method void functionName() Description > */ > class ClassName { > > function functionName() { > > } > > } > ?> This is not wrong because i need anotations for a proxy object (helps alot in this case) . Class anotation should not just be magic method helpers. Annotations are there to provide information about a code block. But if this is considered the standard for netbeans is ok . P.S. : magic methods are wrong, proxy objects with private methods/properties should be used instead. Ofcourse depends on the design style. In my case, class annotations would help alot with my proxy objects. (In reply to Ondrej Brejla from comment #1) > It "is" method redeclaration. You shoudn't use @method annotation if there > is a real method declared in a class. @method annotation is just for "magic" > methods. > > This is really wrong: > > <?php > /** > * @method void functionName() Description > */ > class ClassName { > > function functionName() { > > } > > } > ?> Another thing to note . Magic methods are not just for undeclared methods . They are also for declared methods but innaccesible (private/protected scope). Using class anotation would help by showing code hinting . The code hint will show that the method is accessible , and the __call() magic method will take care of the calling circumstance. Any way you will look at it, the class annotation's logic seems buggy (using proxys or magic methods) . I think you should review the whole thing about class annotations (at least @method @property annotations) This is not resolved. Are you seriously closing this without rechecking the logic ? Please review my replys. @method annotation exposes public api of the class. If you declared "private foo()" in a class, there is no need to expose it by @method and hide that call into __call() method. It's ugly. You can change the method access modifier to public and do all needed checks inside it. But yes, I understand your problem, but I don't think that I want to implement it, because that approach doesn't seem to be nice. That code is overcomplicated then. But I'll think about it once again later, so leaving as P4 as a reminder. Thanks. Created attachment 148204 [details]
Patch
It disables checking of magic methods by "redeclaration" hint.
|