Possible to display private members in Code Completion? |
|
Is there a setting to allow the display (in code completion) of private members in objects?
|
||||||||||||
|
Guru master
|
They should be displayed when you can actually access them in the context you are currently in.
|
||||||||||||
|
|
Example:
class frank { private $dog; public $animal; } $me = new frank(); $me->(the context window will only display animal) Need to see $dog to. |
||||||||||||
|
|
Well you set $dog as public, that's the whole point of property scope ain't it?
|
||||||||||||
|
Guru master
|
As i said, the private members only show up if you can actually access them from that place in your code.
If you were to define a function within the class and would try the code insight then the private members are included. |
||||||||||||
|
Veteran
|
Linchat: code completion works at this point very well.
class frank { private $dog; public $animal; function Test() { $this->[code completion shows both dog and animal] } } $f = new frank(); $f->[you will see only Test and animal - a dog is private, schould not be called here, right?] |
||||||||||||
_________________ ML |
|
My problem is I am trying to work around some limitations. Some IDE's will allow you to configure object and there accessors through PHPDOC @property. I would like to do this so I do NOT have to get into the whole __get __set mess of objects. But using PHPDOC I do not have to remember every properties name I was access to.
Example
|
||||||||||||||
|
Veteran
|
I think noone schould be able to access private members outside the class. That is really good point here.
But if You do not member Your members, maby You could check "Code Explorer" ? There You have of course list of all project's classes, methods, members and more. |
||||||||||||
_________________ ML |
|
If I understand correctly, You want to have code completion working for variables accessed only by getters/setters? If its true, then do the following trick
|
||||||||||||||
|
|
Thanks, I am going to try that. Here is something of what I would like to achieve. Seems like IDE's should have some capability to do this, but none of them do. Basically it allows the "Universal Access Principle"
|
||||||||||||||
|
|
That solution worked, I mad a minor revision to your code. You have to UNSET the public variable when every you SET the protected variable. __SET does not work the second time around because the varialbe now exists after being set. The constructor fixes it the first time, not the second. But good solution. Though adds some extra weight to the code, I think it is better then the alternative for now. Hundred of getXXX setXXX functions.
Hopefull NuSphere will jump in on this, take the lead and beat the rest of the IDE's to this. Here is my addendum:
|
||||||||||||||
|
Possible to display private members in Code Completion? |
|
||
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