Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.3332 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 11 | public function get(string $domainName): ?StorageItem |
|
22 | { |
||
23 | 11 | $storageItem = $this->cache[$domainName] ?? null; |
|
24 | |||
25 | 11 | if ($storageItem !== null && $storageItem->getExpiredAt() < new \DateTimeImmutable()) { |
|
26 | unset($this->cache[$domainName]); |
||
27 | $storageItem = null; |
||
28 | } |
||
29 | |||
30 | 11 | return $storageItem; |
|
31 | } |
||
38 |