| Conditions | 4 |
| Paths | 3 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function visit($hostname, ParsedHostname $parsedHostname): void |
||
| 18 | { |
||
| 19 | $hostname = string($hostname); |
||
| 20 | if ($hostname->startsWith('[') && $hostname->endsWith(']')) { |
||
| 21 | $ipv6 = (string) $hostname->removeLeft('[')->removeRight(']'); |
||
| 22 | if (\filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { |
||
| 23 | $parsedHostname->setIsIpv6(true); |
||
| 24 | } |
||
| 25 | } |
||
| 26 | } |
||
| 27 | } |
||
| 28 |