1 | <?php |
||
10 | class IntervalParser { |
||
11 | /** |
||
12 | * @param string|int|array $interval |
||
13 | * @param DateTimeInterface|null $now |
||
14 | * @return DateTimeImmutable |
||
15 | */ |
||
16 | public static function getNext($interval, DateTimeInterface $now = null): DateTimeImmutable { |
||
36 | |||
37 | /** |
||
38 | * @param string|array $interval |
||
39 | * @param DateTimeImmutable $now |
||
40 | * @return Generator|DateTimeImmutable[] |
||
41 | */ |
||
42 | private static function parse($interval, DateTimeImmutable $now) { |
||
53 | |||
54 | /** |
||
55 | * @param int $interval |
||
56 | * @param DateTimeImmutable $now |
||
57 | * @return DateTimeImmutable |
||
58 | */ |
||
59 | private static function parseInt(int $interval, DateTimeImmutable $now): DateTimeImmutable { |
||
62 | |||
63 | /** |
||
64 | * @param string $interval |
||
65 | * @param DateTimeImmutable $now |
||
66 | * @return DateTimeImmutable |
||
67 | */ |
||
68 | private static function parseString(string $interval, DateTimeImmutable $now): DateTimeImmutable { |
||
82 | |||
83 | /** |
||
84 | * @param array $possibleDates |
||
85 | * @param DateTimeImmutable $now |
||
86 | * @return DateTimeImmutable |
||
87 | */ |
||
88 | private static function nearst(array $possibleDates, DateTimeImmutable $now) { |
||
103 | } |
||
104 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.