Yaffs site version 1.1
[yaffs-website] / vendor / phpunit / phpunit / tests / _files / TestIterator2.php
1 <?php
2 class TestIterator2 implements Iterator
3 {
4     protected $data;
5
6     public function __construct(array $array)
7     {
8         $this->data = $array;
9     }
10
11     public function current()
12     {
13         return current($this->data);
14     }
15
16     public function next()
17     {
18         next($this->data);
19     }
20
21     public function key()
22     {
23         return key($this->data);
24     }
25
26     public function valid()
27     {
28         return key($this->data) !== null;
29     }
30
31     public function rewind()
32     {
33         reset($this->data);
34     }
35 }