Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
5 | class StringIterator extends \ArrayIterator |
||
6 | { |
||
7 | /** |
||
8 | * StringIterator constructor. |
||
9 | * |
||
10 | * @param string $string |
||
11 | */ |
||
12 | 12 | public function __construct(string $string = '') |
|
15 | 12 | } |
|
16 | |||
17 | /** |
||
18 | * @param string $value |
||
19 | * |
||
20 | * @return bool |
||
21 | */ |
||
22 | 7 | public function is(string $value): bool |
|
23 | { |
||
24 | 7 | return $value === $this->current(); |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param string $value |
||
29 | * |
||
30 | * @return bool |
||
31 | */ |
||
32 | 10 | public function isNot(string $value): bool |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return string |
||
39 | */ |
||
40 | 3 | public function __toString() |
|
45 |