1 | <?php |
||
44 | class ArrayBuffer implements \Iterator |
||
45 | { |
||
46 | /** |
||
47 | * The array |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $array; |
||
52 | |||
53 | /** |
||
54 | * Creates an array buffer from an array |
||
55 | * |
||
56 | * @param array $array The array |
||
57 | */ |
||
58 | 20 | public function __construct(array $array) |
|
63 | |||
64 | /** |
||
65 | * Implements Iterator |
||
66 | * |
||
67 | * @link http://php.net/manual/en/iterator.current.php |
||
68 | * @return string |
||
69 | */ |
||
70 | 20 | public function current() |
|
74 | |||
75 | /** |
||
76 | * Implements Iterator |
||
77 | * |
||
78 | * @link http://php.net/manual/en/iterator.next.php |
||
79 | */ |
||
80 | 20 | public function next() |
|
84 | |||
85 | /** |
||
86 | * Implements Iterator |
||
87 | * |
||
88 | * @link http://php.net/manual/en/iterator.key.php |
||
89 | * @return integer|boolean False on failure |
||
90 | */ |
||
91 | 2 | public function key() |
|
95 | |||
96 | /** |
||
97 | * Implements Iterator |
||
98 | * |
||
99 | * @link http://php.net/manual/en/iterator.valid.php |
||
100 | * @return boolean |
||
101 | */ |
||
102 | 2 | public function valid() |
|
106 | |||
107 | /** |
||
108 | * Implements Iterator |
||
109 | * |
||
110 | * @link http://php.net/manual/en/iterator.rewind.php |
||
111 | */ |
||
112 | 8 | public function rewind() |
|
116 | } |
||
117 |