Code completion: Iterator and ArrayAccess usage |
|
Since PHP 5.0 we have a great feature - implementable Iterators:
http://www.php.net/~helly/php/ext/spl/interfaceIterator.html Unfortunately, phpEd does not use its declaration for type analysis in code completion:
When Iterator is implemented, it should use the return value of current() method to find type of $element in foreach. It would be also great, if phpEd uses ArrayAccess interface: http://www.php.net/~helly/php/ext/spl/interfaceArrayAccess.html
It would really speed up working with object collections with PHP5. |
||||||||||||||||
|
|
So has anyone found a trick or anything to get this to work. It would make my life much easier and obviously Nataniel's.
TW |
||||||||||||
|
Site Admin
|
I think it's answered there http://forum.nusphere.com/code-completion-for-php-spl-dom-pdo-and-dom-t1733.html
|
||||||||||||
_________________ The PHP IDE team |
|
No, it's not? Adding SPL.php to the include list only allows to complete methods/classes of SPL itself, not the methods of custom objects using SPL features. |
||||||||||||||
|
|
It doesn't work for me either.
|
||||||||||||
|
Site Admin
|
Code completion recognizes many things and you can help it serve you better by providing prototypes and type hints. Could you please post a more detailed info regarding what does not work for you?
|
||||||||||||
_________________ The PHP IDE team |
|
|
||||||||||||
|
Site Admin
|
did you mean this?
otherwise I see no way how to get a from b and how would code insight recognize this... Even with correction, I doubt if it's clear... |
||||||||||||||
_________________ The PHP IDE team |
|
alas, I forgot some of the most important aspects of the object didn't I.
What I was trying to point out is I can add a /** @var a */ to make the $d look like the correct data type. It is crude but it works. Code Completion doesn't work complete from the current() method unless you directly call the current() method. |
||||||||||||
|
Code completion: Iterator and ArrayAccess usage |
|
||
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