Code Completion for Class private/protected members/methods |
Guru master
|
Because mymember is protected, surely it is correct for code completion to not work?
You could make mymember public, then code completion would work. |
||||||||||||
|
|
In general this is correct but for magic setters/getter, as is mentioned it, it's a bit disturbing.
In PHP you CAN access protected/private members, when you define the magic setters/getters. But you can't use magic getter/setters for public members. http://www.php.net/manual/en/language.oop5.overloading.php#object.get Therefore it would be cool to have an option in nusphere settings to allow protected/private member auto completion. It's really helpful when you have protected/private members that be accessable/writeable through the magic getters/setters. |
||||||||||||
|
Guru master
|
You mention PHPDoc but do you mean using @method ?
The above works in PhpED plus it also clearly documents that there is a predefined protected/private variable that can be accessed. If you extend class Test then PhpED does offer mymember in code completion without using @method, because PhpED knows that mymember should be directly accessible:
|
||||||||||||||||
|
|
First a little note.
The @method works more worse than good because it's handled as a method, which it isn't. Let me exactly explain why i want the auto completion. I have this (strongly simplified)
As you can see, "$obj->createTime->" offers you a correct code completion list for the methods and members for the DateTime object (this is what already works fine). But when i just type "$obj->crea" i want a auto completion to write my code faster. This way i use is really fast for creating new childs of this class without the need of creating a getter/setter for each member. A public member instead of protected is not possible in my case because many conversations happens in the magic __get/__set which i've removed in this examplecode. Please let us not talk about my way of coding, if someone try to. I just wanted to suggest that it would be helpful for some people, like me, with a auto completion - And i just explain why this would be helpful to give the DEV's a reason to think about. |
||||||||||||||
|
Guru master
|
What about this then?
|
||||||||||||||
|
|
That's what i searched for. Thank you. |
||||||||||||||
|
Code Completion for Class private/protected members/methods |
|
||
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