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): ?DnsRecord |
|
22 | { |
||
23 | 11 | $dnsRecord = $this->cache[$domainName] ?? null; |
|
24 | |||
25 | 11 | if ($dnsRecord !== null && $dnsRecord->getExpiredAt() < new \DateTimeImmutable()) { |
|
26 | unset($this->cache[$domainName]); |
||
27 | $dnsRecord = null; |
||
28 | } |
||
29 | |||
30 | 11 | return $dnsRecord; |
|
31 | } |
||
38 |