ip = $ip; } public static function isValid(string $ip): bool { return Factory::parseAddressString($ip) !== null; } public function matches(IRange... $ranges): bool { foreach ($ranges as $range) { if ($range->contains($this)) { return true; } } return false; } public function __toString(): string { return $this->ip->toString(); } }