return;
}
- $this->localAddressChecker->ThrowIfLocalAddress($uri);
+ $this->localAddressChecker->throwIfLocalAddress($uri);
}
/**
$curlResolves["$hostName:$port"] = [];
foreach ($targetIps as $ip) {
- $this->localAddressChecker->ThrowIfLocalIp($ip);
+ $this->localAddressChecker->throwIfLocalIp($ip);
$curlResolves["$hostName:$port"][] = $ip;
}
}
$this->logger = $logger;
}
- public function ThrowIfLocalIp(string $ip) : void {
+ public function throwIfLocalIp(string $ip) : void {
$parsedIp = Factory::parseAddressString(
$ip,
ParseStringFlag::IPV4_MAYBE_NON_DECIMAL | ParseStringFlag::IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED
}
}
- public function ThrowIfLocalAddress(string $uri) : void {
+ public function throwIfLocalAddress(string $uri) : void {
$host = parse_url($uri, PHP_URL_HOST);
if ($host === false || $host === null) {
$this->logger->warning("Could not detect any host in $uri");
throw new LocalServerException('Host violates local access rules');
}
- $this->ThrowIfLocalIp($host);
+ $this->throwIfLocalIp($host);
}
}
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
$this->expectException(LocalServerException::class);
$this->localAddressChecker
->expects($this->once())
- ->method('ThrowIfLocalAddress')
+ ->method('throwIfLocalAddress')
->with('http://' . $uri)
->will($this->throwException(new LocalServerException()));
*/
public function testThrowIfLocalAddress($uri) : void {
$this->expectException(LocalServerException::class);
- $this->localAddressChecker->ThrowIfLocalAddress('http://' . $uri);
+ $this->localAddressChecker->throwIfLocalAddress('http://' . $uri);
}
/**
* @param string $uri
*/
public function testThrowIfLocalAddressGood($uri) : void {
- $this->localAddressChecker->ThrowIfLocalAddress('http://' . $uri);
+ $this->localAddressChecker->throwIfLocalAddress('http://' . $uri);
$this->assertTrue(true);
}
*/
public function testThrowIfLocalIpBad($ip) : void {
$this->expectException(LocalServerException::class);
- $this->localAddressChecker->ThrowIfLocalIp($ip);
+ $this->localAddressChecker->throwIfLocalIp($ip);
}
/**
* @param string $ip
*/
public function testThrowIfLocalIpGood($ip) : void {
- $this->localAddressChecker->ThrowIfLocalIp($ip);
+ $this->localAddressChecker->throwIfLocalIp($ip);
$this->assertTrue(true);
}