cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[NFR]: Change return type of `Phalcon\Collection:getIterator()` to `ArrayIterator`

Open Jeckerson opened this issue 4 years ago • 1 comments

Current Traversable interface does not has any methods signatures, which is not practical in terms of autocomplete of methods and for static code analysers.

https://github.com/phalcon/cphalcon/blob/645cf382358b96cbe9659f6634f41c940e89a7e4/phalcon/Collection.zep#L147

Jeckerson avatar Oct 11 '21 19:10 Jeckerson

After discussion, we will make changes to this method and remove the return type. The body of the code will be a loop utilizing yield.

This is currently work in progress in Zephir.

Related (and blocker): https://github.com/zephir-lang/zephir/issues/1849

niden avatar Oct 12 '21 13:10 niden