| Conditions | 4 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 142 | private function timestampWithGlobalTtl($ttl, int $default = 0): int |
|
| 35 | { |
||
| 36 | 142 | $explicit = normalize_ttl($ttl); |
|
| 37 | 142 | $now = now()->getTimestamp(); |
|
| 38 | 142 | if (null === $explicit && $this->ttl > 0) { |
|
|
|
|||
| 39 | 2 | return $now + $this->ttl; |
|
| 40 | } |
||
| 41 | 141 | if ($explicit > 0) { |
|
| 42 | 8 | return $now + $explicit; |
|
| 43 | } |
||
| 44 | 133 | return $explicit ?? $default; |
|
| 45 | } |
||
| 55 | } |