1 | <?php |
||
11 | class IntervalParser { |
||
12 | /** |
||
13 | * @param string|int|array $interval |
||
14 | * @param DateTimeInterface|null $now |
||
15 | * @return DateTimeImmutable |
||
16 | */ |
||
17 | public static function getNext($interval, DateTimeInterface $now = null): DateTimeImmutable { |
||
35 | |||
36 | /** |
||
37 | * @param $interval |
||
38 | * @param DateTimeInterface|null $now |
||
39 | * @return Generator|DateTimeImmutable |
||
40 | */ |
||
41 | private static function parse($interval, DateTimeInterface $now) { |
||
52 | |||
53 | /** |
||
54 | * @param int $interval |
||
55 | * @param DateTimeInterface $now |
||
56 | * @return DateTimeImmutable |
||
57 | */ |
||
58 | private static function parseInt(int $interval, DateTimeInterface $now): DateTimeImmutable { |
||
61 | |||
62 | /** |
||
63 | * @param string $interval |
||
64 | * @param DateTimeInterface $now |
||
65 | * @return DateTimeInterface |
||
66 | */ |
||
67 | private static function parseString(string $interval, DateTimeInterface $now): DateTimeInterface { |
||
83 | |||
84 | /** |
||
85 | * @param array $possibleDates |
||
86 | * @param DateTimeInterface $now |
||
87 | * @return DateTimeInterface |
||
88 | */ |
||
89 | private static function nearst(array $possibleDates, DateTimeInterface $now) { |
||
104 | } |
||
105 |
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.