| Conditions | 6 |
| Paths | 8 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 56 | public function resolveTTL(string|int|null $ttl): ?int |
||
| 57 | { |
||
| 58 | $ttlToUse = $ttl; |
||
| 59 | |||
| 60 | if ($this->defaultTTL !== null && ($ttl === null || (int) $ttl === 3600)) { |
||
| 61 | $ttlToUse = $this->defaultTTL; |
||
| 62 | } |
||
| 63 | |||
| 64 | if (is_string($ttlToUse)) { |
||
| 65 | $ttlToUse = (int) CacheFileHelper::convertExpirationToSeconds($ttlToUse); |
||
| 66 | } |
||
| 67 | |||
| 68 | return $ttlToUse === null ? null : (int) $ttlToUse; |
||
| 69 | } |
||
| 71 |