Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
36 | 175 | private function timestampWithGlobalTtl($ttl, int $default = 0): int |
|
37 | { |
||
38 | 175 | $explicit = normalize_ttl($ttl); |
|
39 | 145 | $now = now()->getTimestamp(); |
|
40 | |||
41 | 145 | if (null === $explicit && $this->ttl > 0) { |
|
|
|||
42 | 2 | return $now + $this->ttl; |
|
43 | } |
||
44 | |||
45 | 144 | if ($explicit > 0) { |
|
46 | 8 | return $now + $explicit; |
|
47 | } |
||
48 | |||
49 | 136 | return $explicit ?? $default; |
|
50 | } |
||
62 | } |