diff --git a/src/ClientConfiguration.php b/src/ClientConfiguration.php index db9d89fff..a0e61bf02 100644 --- a/src/ClientConfiguration.php +++ b/src/ClientConfiguration.php @@ -61,8 +61,7 @@ public static function fromArray(array $config): self /** * Create configuration from Dsn string. Example of valid DSN strings: * - http://localhost - * - http://foo:bar@localhost:1234?timeout=4&persistant=false - * - pool(http://127.0.0.1 http://127.0.0.2/bar?timeout=4). + * - http://foo:bar@localhost:1234?timeout=4&persistant=false. */ public static function fromDsn(string $dsnString): self { @@ -76,14 +75,6 @@ public static function fromDsn(string $dsnString): self /** @var Url $dsn */ $dsn = $func->first(); $clientConfiguration = self::fromArray(self::parseDsn($dsn)); - } elseif ('pool' === $func->getName()) { - $hosts = []; - $clientConfiguration = new static(); - /** @var Url $arg */ - foreach ($func->getArguments() as $arg) { - $hosts[] = self::parseDsn($arg); - } - $clientConfiguration->set('hosts', $hosts); } else { throw new FunctionNotSupportedException($dsnString, $func->getName()); } diff --git a/tests/ClientConfigurationTest.php b/tests/ClientConfigurationTest.php index 4bc6c274a..32d060b88 100644 --- a/tests/ClientConfigurationTest.php +++ b/tests/ClientConfigurationTest.php @@ -38,8 +38,6 @@ public function testFromSimpleDsn(): void 'port' => 9201, 'path' => null, 'url' => null, - 'connections' => [], - 'roundRobin' => false, 'retryOnConflict' => 0, 'username' => null, 'password' => null, @@ -57,8 +55,6 @@ public function testFromDsnWithParameters(): void 'port' => 9201, 'path' => '/my-path', 'url' => null, - 'connections' => [], - 'roundRobin' => true, 'retryOnConflict' => 2, 'username' => 'user', 'password' => 'p4ss', @@ -69,29 +65,6 @@ public function testFromDsnWithParameters(): void $this->assertEquals($expected, $configuration->getAll()); } - public function testFromDsnWithPool(): void - { - $configuration = ClientConfiguration::fromDsn('pool(http://nicolas@127.0.0.1 http://127.0.0.2/bar?timeout=4)?extra=abc&username=tobias'); - $expected = [ - 'host' => null, - 'port' => null, - 'path' => null, - 'url' => null, - 'connections' => [ - ['host' => '127.0.0.1', 'username' => 'nicolas'], - ['host' => '127.0.0.2', 'path' => '/bar', 'timeout' => 4], - ], - 'roundRobin' => false, - 'retryOnConflict' => 0, - 'username' => 'tobias', - 'password' => null, - 'extra' => 'abc', - 'transport_config' => [], - ]; - - $this->assertEquals($expected, $configuration->getAll()); - } - public function testFromEmptyArray(): void { $configuration = ClientConfiguration::fromArray([]); @@ -101,8 +74,6 @@ public function testFromEmptyArray(): void 'port' => null, 'path' => null, 'url' => null, - 'connections' => [], // host, port, path, timeout, transport, compression, timeout, username, password, config -> (curl, headers, url) - 'roundRobin' => false, 'retryOnConflict' => 0, 'username' => null, 'password' => null, @@ -124,8 +95,6 @@ public function testFromArray(): void 'port' => null, 'path' => null, 'url' => null, - 'connections' => [], // host, port, path, timeout, transport, compression, timeout, username, password, config -> (curl, headers, url) - 'roundRobin' => false, 'retryOnConflict' => 0, 'username' => 'Jdoe', 'password' => null, @@ -152,8 +121,6 @@ public function testGet(): void 'port' => null, 'path' => null, 'url' => null, - 'connections' => [], - 'roundRobin' => false, 'retryOnConflict' => 0, 'username' => null, 'password' => null,