NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
code completition on (runtime created) objects?


Joined: 22 Dec 2005
Posts: 6
Reply with quote
Hello,

how can I achieve that the phped ide does code completition on objects?

Example:

Code:
  $myObj = factoryObject::Create("some object");   // returns an object instance

  $myObj->*


*should show the member functions of "some_object_class"
Afaik this is not a PHP feature which checks the member functions at runtime, but maybe there is a way to hint the IDE?

thanks
Husker
View user's profileFind all posts by HuskerSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Actually I put this on the FAQ some time ago. http://forum.nusphere.com/tip-type-hints-t1563.html
Regarding your code, if your factory returns instances of one class, no type hints are requried. Phped 4048 is able to recognize everything in this case, like below:



If your factory may return instances of different classes, depending for example on the arguments passed to ::Create(), you may want to add type hint like below:
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Dec 2005
Posts: 6
Reply with quote
ddmitrie wrote:
Actually I put this on the FAQ some time ago. http://forum.nusphere.com/tip-type-hints-t1563.html


Thanks for the tips. I tried to search the Forum but I might have used the wrong search terms.

Happy holidays,

Husker
View user's profileFind all posts by HuskerSend private message
code completition on (runtime created) objects?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic