function NoProxyPattern::getRule
Finds or creates rule data for a hostname
Return value
null|stdClass Null if the hostname is invalid
1 call to NoProxyPattern::getRule()
- NoProxyPattern::match in vendor/
composer/ composer/ src/ Composer/ Util/ NoProxyPattern.php - Returns true if the url is matched by a rule
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ NoProxyPattern.php, line 169
Class
- NoProxyPattern
- Tests URLs against NO_PROXY patterns
Namespace
Composer\UtilCode
private function getRule(int $index, string $hostName) : ?stdClass {
if (array_key_exists($index, $this->rules)) {
return $this->rules[$index];
}
$this->rules[$index] = null;
[
$host,
$port,
$err,
] = $this->splitHostPort($hostName);
if ($err || !$this->ipCheckData($host, $ipdata, true)) {
return null;
}
$this->rules[$index] = $this->makeData($host, $port, $ipdata);
return $this->rules[$index];
}