Conditions | 3 |
Paths | 4 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | private function timeFrequency($frequency, $time = null) { |
||
38 | if ($time === null) $time = time(); |
||
39 | $num = (int) $frequency; |
||
40 | $unit = strtoupper(trim(str_replace($num, '', $frequency))); |
||
41 | |||
42 | $offset = $num * constant(self::class . '::' . $unit); |
||
43 | |||
44 | if ($time > $this->lastRun + $offset) return true; |
||
45 | else return false; |
||
46 | } |
||
47 | |||
58 | } |