| 1 | <?php |
||
| 5 | class FileCatalog implements \Iterator, \ArrayAccess |
||
| 6 | { |
||
| 7 | |||
| 8 | private $entries = []; |
||
| 9 | |||
| 10 | private $current = 0; |
||
| 11 | |||
| 12 | |||
| 13 | // implementing Iterator interface |
||
| 14 | 1 | public function current() |
|
| 18 | |||
| 19 | |||
| 20 | 1 | public function key() |
|
| 24 | |||
| 25 | |||
| 26 | 1 | public function next() |
|
| 30 | |||
| 31 | |||
| 32 | 2 | public function rewind() |
|
| 36 | |||
| 37 | |||
| 38 | 2 | public function valid() |
|
| 42 | |||
| 43 | |||
| 44 | // implementing ArrayAccess interface |
||
| 45 | 3 | public function offsetExists($offset) |
|
| 49 | |||
| 50 | |||
| 51 | 3 | public function offsetSet($offset, $value) |
|
| 65 | |||
| 66 | |||
| 67 | 2 | public function offsetGet($offset) |
|
| 75 | |||
| 76 | |||
| 77 | 2 | public function offsetUnset($offset) |
|
| 81 | } |
||
| 82 |