Skip to content

Commit 89f4590

Browse files
committed
Added UnexpectedValueException for normalization invalid IPv6
1 parent 7a7326d commit 89f4590

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Mesour/IpAddresses/IpAddressNormalizer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ final public static function normalizeIpV6($address): string
3434
$result = implode(':', $part);
3535
if (strlen($result) == 39) {
3636
return $result;
37-
} else {
38-
return false;
3937
}
38+
throw new \UnexpectedValueException('Ip address is not valid.');
4039
}
4140

4241
final public static function compressIpV6($ip): string

0 commit comments

Comments
 (0)