InfiniteArrayCollection::getInfiniteIterator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Utils\Collections;
4
5
/**
6
 * Infinite ArrayCollection
7
 */
8
class InfiniteArrayCollection extends ArrayCollection
9
{
10
    /**
11
     * @return \GameDomain\Player\PlayerInterface[]|\InfiniteIterator
12
     */
13
    final public function getInfiniteIterator()
14
    {
15
        $this->first();
16
17
        return new \InfiniteIterator($this->getIterator());
18
    }
19
}
20