Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | protected function validateTTL($ttl) |
||
20 | { |
||
21 | if ($ttl === null) { |
||
22 | return; |
||
23 | } |
||
24 | |||
25 | if ($ttl instanceof \DateInterval) { |
||
26 | return; |
||
27 | } |
||
28 | |||
29 | if (is_int($ttl)) { |
||
30 | return; |
||
31 | } |
||
32 | |||
33 | throw new InvalidArgumentException('$ttl must be null, an integer or \DateInterval instance'); |
||
34 | } |
||
36 |