Total Complexity | 6 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | abstract class AbstractDateRangeIterator implements Iterator |
||
15 | { |
||
16 | /** |
||
17 | * @var DateRange |
||
18 | */ |
||
19 | protected $dateRange; |
||
20 | |||
21 | /** |
||
22 | * @var DateInterval |
||
23 | */ |
||
24 | protected $interval; |
||
25 | |||
26 | /** |
||
27 | * @var int |
||
28 | */ |
||
29 | protected $key = 0; |
||
30 | |||
31 | /** |
||
32 | * @var DateTimeImmutable |
||
33 | */ |
||
34 | protected $current; |
||
35 | |||
36 | /** |
||
37 | * @param DateRange $dateRange |
||
38 | * @param DateInterval|null $interval |
||
39 | */ |
||
40 | 8 | public function __construct(DateRange $dateRange, DateInterval $interval = null) |
|
44 | 8 | } |
|
45 | |||
46 | /** |
||
47 | * @return DateTimeImmutable |
||
48 | */ |
||
49 | 8 | public function current(): DateTimeImmutable |
|
50 | { |
||
51 | 8 | return $this->current; |
|
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return int |
||
56 | */ |
||
57 | 2 | public function key(): int |
|
58 | { |
||
59 | 2 | return $this->key; |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return bool |
||
64 | */ |
||
65 | 8 | public function valid(): bool |
|
69 | } |
||
70 | } |
||
71 |