Conditions | 5 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
46 | 1 | private function getDates(CronExpression $rRule, DateTimeInterface $from, DateTimeInterface $to, $inc) |
|
47 | { |
||
48 | 1 | $firstIteration = true; |
|
49 | 1 | $result = []; |
|
50 | do { |
||
51 | 1 | $nextRunDate = $rRule->getNextRunDate($from, 0, $firstIteration && $inc); |
|
|
|||
52 | 1 | if ($nextRunDate->getTimestamp() < ($to->getTimestamp() + (int) $inc) && $from->getTimestamp() <= $nextRunDate->getTimestamp()) { |
|
53 | 1 | $result[] = $nextRunDate; |
|
54 | 1 | } |
|
55 | 1 | $firstIteration = false; |
|
56 | 1 | $from = $nextRunDate; |
|
57 | 1 | } while ($nextRunDate->getTimestamp() < ($to->getTimestamp() + (int) $inc)); |
|
58 | 1 | return $result; |
|
59 | } |
||
60 | } |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.