mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-21 20:36:05 +03:00
Use array_keys for iterating over NodeList
This commit is contained in:
parent
49b7aced87
commit
e5b955ecc8
@ -114,9 +114,8 @@ class NodeList implements ArrayAccess, IteratorAggregate, Countable
|
||||
*/
|
||||
public function getIterator()
|
||||
{
|
||||
$count = count($this->nodes);
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
yield $this->offsetGet($i);
|
||||
foreach (array_keys($this->nodes) as $key) {
|
||||
yield $this->offsetGet($key);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user