IpAllowlist
API reference › Debug › IpAllowlist
Matches a requesting IP against the debugger’s allowed IP filters and host allowlist.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Retains the IP filters and hostnames used when checking access. | IpAllowlist |
matches() | Returns whether the IP matches any allowed IP filter or resolves from any allowed host. | IpAllowlist |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(list<string> $allowedIPs, list<string> $allowedHosts)Retains the IP filters and hostnames used when checking access.
Parameters
| Parameter | Type | Description |
|---|---|---|
$allowedIPs | list<string> | Exact, wildcard, or CIDR IP filters. |
$allowedHosts | list<string> | Hostnames resolved to IPs at check time. |
matches()
Section titled “matches() ”public function matches(string $ip): boolReturns whether the IP matches any allowed IP filter or resolves from any allowed host.
Parameters
| Parameter | Type | Description |
|---|---|---|
$ip | string | Requesting IP address. |
Returns
bool: true when the IP is allowed.