Setting type of global objects |
Site Admin
|
Thanks for the report.
Fix will come with build 4522: |
||||||||||||
|
|
Wow, thanks, that was quick.
What about functions that return objects? I'd imagine it's pretty hard to determine the type of object, especially as it could be dependant on runtime conditions. Also, what if the object is created in another file? |
||||||||||||
|
Site Admin
|
it does not really matter if new is called in another file, what does matter is how the resuling object is "delivered" to the point.
Regarding objects returned as a function or method result, it is supported while you keep clear code and it's clear what class instance is created by new, otherwise you have to add typehint to "suggest" code insight the object type. If you ever encounter anything that might work but does not, feel free to submit code sample. |
||||||||||||
|
|
What do you mean by adding a typehint? Is that a PHPDoc comment? I can't figure out how to use these and I can't find any documentation (not even on the PHPDoc site, pretty strange for a documentation program not to have decent documentation!).
|
||||||||||||
|
|
I'm still having trouble with this (build 4523), it is at least partially functioning but there are flaws. For example:
This doesn't work (can't determine type of local variable $obj), however if I remove the global line, it has no problem determining that $obj is a MyClass(). |
||||||||||||||
|
Setting type of global objects |
|
||
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