Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
52 | public function next() |
||
53 | { |
||
54 | $this->secondIndex++; |
||
55 | if($this->secondIndex >= $this->maxIndex) |
||
56 | { |
||
57 | $this->firstIndex++; |
||
58 | $this->secondIndex = $this->firstIndex + 1; |
||
59 | } |
||
60 | if($this->secondIndex >= $this->maxIndex) |
||
61 | { |
||
62 | $this->hasNext = false; |
||
63 | return null; |
||
64 | } |
||
65 | |||
66 | return $this->current(); |
||
67 | } |
||
68 | |||
74 |
Only declaring a single property per statement allows you to later on add doc comments more easily.
It is also recommended by PSR2, so it is a common style that many people expect.