1 | <?php |
||
5 | class Pairs implements \Iterator |
||
6 | { |
||
7 | private |
||
8 | $hasNext, |
||
9 | $firstIndex, |
||
10 | $secondIndex, |
||
11 | $maxIndex, |
||
12 | $keys, |
||
13 | $values; |
||
14 | |||
15 | public function __construct(array $items) |
||
34 | |||
35 | public function rewind() |
||
41 | |||
42 | public function current() |
||
46 | |||
47 | public function key() |
||
51 | |||
52 | public function next() |
||
68 | |||
69 | public function valid() |
||
73 | } |
||
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.