Lines Matching refs:ip
80 * @param string $ip The IPv4 or IPv6 address.
86 public static function ipToNumber(string $ip): array argument
88 $binary = inet_pton($ip);
91 throw new Exception('Invalid IP: ' . $ip);
113 * @param string $ip The address to test.
118 public static function ipMatches(string $ip, string $ipOrRange): bool argument
125 return Ip::ipToNumber($ip) === Ip::ipToNumber($ipOrRange);
128 return Ip::ipInRange($ip, $ipOrRange);
141 * @param string $ip The IP address of the proxy.
145 public static function proxyIsTrusted(string $ip): bool argument
155 if (Ip::ipMatches($ip, $trusted)) {
271 $ips = array_filter($ips, static fn($ip) => filter_var($ip, FILTER_VALIDATE_IP));