]> source.dussan.org Git - nextcloud-server.git/commitdiff
Rename LocalAddressChecker methods to lower case 34847/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 27 Oct 2022 11:24:28 +0000 (13:24 +0200)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Thu, 27 Oct 2022 11:24:28 +0000 (13:24 +0200)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
lib/private/Http/Client/Client.php
lib/private/Http/Client/DnsPinMiddleware.php
lib/private/Http/Client/LocalAddressChecker.php
tests/lib/Http/Client/ClientTest.php
tests/lib/Http/Client/LocalAddressCheckerTest.php

index 4bf7fd02400095483fc7486ce03021a252f1e5e9..d4dba3e5a446d0fb5125beb495bf52df3a9342d3 100644 (file)
@@ -181,7 +181,7 @@ class Client implements IClient {
                        return;
                }
 
-               $this->localAddressChecker->ThrowIfLocalAddress($uri);
+               $this->localAddressChecker->throwIfLocalAddress($uri);
        }
 
        /**
index f5e6214a4ab45cb66934d0632ba6cd6b9bc9a9ac..00bc209d7b16ab1d1c65f92001de0560d4259f66 100644 (file)
@@ -133,7 +133,7 @@ class DnsPinMiddleware {
                                        $curlResolves["$hostName:$port"] = [];
 
                                        foreach ($targetIps as $ip) {
-                                               $this->localAddressChecker->ThrowIfLocalIp($ip);
+                                               $this->localAddressChecker->throwIfLocalIp($ip);
                                                $curlResolves["$hostName:$port"][] = $ip;
                                        }
                                }
index 13a7d062de3bdb7699a2006d29096bd5b7892e50..eb24f002d7d8379d09c75cd4cd17a84bcaa8e2c3 100644 (file)
@@ -39,7 +39,7 @@ class LocalAddressChecker {
                $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
@@ -70,7 +70,7 @@ class LocalAddressChecker {
                }
        }
 
-       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");
@@ -97,6 +97,6 @@ class LocalAddressChecker {
                        throw new LocalServerException('Host violates local access rules');
                }
 
-               $this->ThrowIfLocalIp($host);
+               $this->throwIfLocalIp($host);
        }
 }
index 25d4749df574cf668ca0a86923232330d5b5ac2e..fa2374aeb7e6111924e65788791ca38af58cbd97 100644 (file)
@@ -203,7 +203,7 @@ class ClientTest extends \Test\TestCase {
                $this->expectException(LocalServerException::class);
                $this->localAddressChecker
                        ->expects($this->once())
-                       ->method('ThrowIfLocalAddress')
+                       ->method('throwIfLocalAddress')
                        ->with('http://' . $uri)
                        ->will($this->throwException(new LocalServerException()));
 
@@ -218,7 +218,7 @@ class ClientTest extends \Test\TestCase {
                $this->expectException(LocalServerException::class);
                $this->localAddressChecker
                        ->expects($this->once())
-                       ->method('ThrowIfLocalAddress')
+                       ->method('throwIfLocalAddress')
                        ->with('http://' . $uri)
                        ->will($this->throwException(new LocalServerException()));
 
@@ -233,7 +233,7 @@ class ClientTest extends \Test\TestCase {
                $this->expectException(LocalServerException::class);
                $this->localAddressChecker
                ->expects($this->once())
-               ->method('ThrowIfLocalAddress')
+               ->method('throwIfLocalAddress')
                ->with('http://' . $uri)
                ->will($this->throwException(new LocalServerException()));
 
@@ -248,7 +248,7 @@ class ClientTest extends \Test\TestCase {
                $this->expectException(LocalServerException::class);
                $this->localAddressChecker
                        ->expects($this->once())
-                       ->method('ThrowIfLocalAddress')
+                       ->method('throwIfLocalAddress')
                        ->with('http://' . $uri)
                        ->will($this->throwException(new LocalServerException()));
 
@@ -263,7 +263,7 @@ class ClientTest extends \Test\TestCase {
                $this->expectException(LocalServerException::class);
                $this->localAddressChecker
                        ->expects($this->once())
-                       ->method('ThrowIfLocalAddress')
+                       ->method('throwIfLocalAddress')
                        ->with('http://' . $uri)
                        ->will($this->throwException(new LocalServerException()));
 
index 8c8e64eddf928b62f2f1e9ceeae9a2c222115e5e..024c52b3705d35926d5d8b89f831c9ebbaff323c 100644 (file)
@@ -47,7 +47,7 @@ class LocalAddressCheckerTest extends \Test\TestCase {
         */
        public function testThrowIfLocalAddress($uri) : void {
                $this->expectException(LocalServerException::class);
-               $this->localAddressChecker->ThrowIfLocalAddress('http://' . $uri);
+               $this->localAddressChecker->throwIfLocalAddress('http://' . $uri);
        }
 
        /**
@@ -55,7 +55,7 @@ class LocalAddressCheckerTest extends \Test\TestCase {
         * @param string $uri
         */
        public function testThrowIfLocalAddressGood($uri) : void {
-               $this->localAddressChecker->ThrowIfLocalAddress('http://' . $uri);
+               $this->localAddressChecker->throwIfLocalAddress('http://' . $uri);
                $this->assertTrue(true);
        }
 
@@ -66,7 +66,7 @@ class LocalAddressCheckerTest extends \Test\TestCase {
         */
        public function testThrowIfLocalIpBad($ip) : void {
                $this->expectException(LocalServerException::class);
-               $this->localAddressChecker->ThrowIfLocalIp($ip);
+               $this->localAddressChecker->throwIfLocalIp($ip);
        }
 
        /**
@@ -74,7 +74,7 @@ class LocalAddressCheckerTest extends \Test\TestCase {
         * @param string $ip
         */
        public function testThrowIfLocalIpGood($ip) : void {
-               $this->localAddressChecker->ThrowIfLocalIp($ip);
+               $this->localAddressChecker->throwIfLocalIp($ip);
                $this->assertTrue(true);
        }