Total Complexity | 6 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
24 | class ArrayRecordSet implements Countable |
||
25 | { |
||
26 | public $EOF = false; |
||
27 | |||
28 | public $fields; |
||
29 | |||
30 | private $_array; |
||
31 | |||
32 | /** |
||
33 | * Constructor. |
||
34 | * |
||
35 | * @param array $data The input array |
||
36 | */ |
||
37 | public function __construct($data) |
||
38 | { |
||
39 | $this->_array = $data; |
||
40 | $this->fields = \reset($this->_array); |
||
41 | |||
42 | if (false === $this->fields) { |
||
43 | $this->EOF = true; |
||
44 | } |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Returns the recordCount. |
||
49 | */ |
||
50 | public function count(): int |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Counts the records in the instance array. |
||
57 | * |
||
58 | * @return int number of records in the instance array |
||
59 | */ |
||
60 | public function recordCount() |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * Advance the internal pointer of the instance array |
||
67 | * if no more fields are left, marks the instance variable $EOF as true. |
||
68 | */ |
||
69 | public function moveNext(): void |
||
78 |