-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Incompatible with RecursiveIterator::hasChildren() Zend\Navigation\AbstractContainer #4517
Comments
@noopable |
I made it. |
Handled in #6825 |
@Ocramius suggested that I ask here: to me, feel free to have other opinions, hasChildren() seems to have different than expected behavior of an RecursiveIterator implementation. Perhaps we call this out in the documentation somewhere? |
Indeed, the name ,RecursiveIterator::hasChildren(), sounds like if RecursiveIterator has children or not. In the PHP Manual, And this relatives to getChildren The ordinary recursive flow is below.
You can see and compare this pattern in the RecursiveArrayIterator or the RecursiveDirectoryIterator and so on. Thanks. |
…-recursive-iterator-compatibility' Close zendframework/zendframework#6825 Close zendframework/zendframework#4517
…-recursive-iterator-compatibility' into develop Close zendframework/zendframework#6825 Close zendframework/zendframework#4517 Forward port zendframework/zendframework#6825 Forward port zendframework/zendframework#4517
However, this should have been marked as Breaking Change in the Release notes! Checking for subpages with |
Zend\Navigation\AbstractContainer implements RecursiveIterator.
But Zend\Navigation\AbstractContainer::hasChildren is incompatible with RecursiveIterator::hasChildren().
RecursiveIterator::hasChildren() is that
Returns if an iterator can be created for the current entry.
// (at)see http://php.net/manual/en/recursiveiterator.haschildren.php
Not that returns if the iterator has entries.
For example, RecursiveArrayIterator::hasChildren returns whether current entry is an array or an object.
It should be
Otherwise, it causes some problems with using RecursiveIteratorIterator::beginChildren and so on.
The text was updated successfully, but these errors were encountered: