db_dataobject factory code insight |
|
Hi, I am demo'ing your product right now and came across something that I would really like to have, if it is not already possible....
I use the Pear DB_DataObject library quite a bit. That library uses a ::factory('CLASSNAME') method to create new instances of the DataObject class. The class name passed to it loads a seperate class file that inherits from DB_DataObject. The problem is, as far as I can tell, that using this method, the code insight tool doesnt know what the return value is, cause it dynamically instantiated. I already read this FAQ posting and it did not seem to answer the question, since the return class type will be different every time. http://forum.nusphere.com/tip-type-hints-t1563.html So is this possible with NuSphere? Or could it be implemented down the road? If it does have it I will buy it today! I work with a lot of DataObject classes, and having the code insight work for those would be awesome. Thanks, Mike |
||||||||||||
|
Site Admin
|
there are two possible ways and both are covered there:
code-insite-with-methods-having-mixed-return-values-t2249.html In short, either add /** return DataObject */ phpdoc before the factory's method, or /** @var <real object class> */ before the assignment, like below: /** @var SomeClass */ $my=factory::createInstance('SomeClass'); $my->| // code completion will work for $my |
||||||||||||
|
db_dataobject factory code insight |
|
||
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