From 5788cbb146d7d901fc41471f7236dee3e0f36b05 Mon Sep 17 00:00:00 2001 From: "Paul M. Jones" Date: Thu, 5 Apr 2018 07:08:18 -0500 Subject: [PATCH] don't actually need factory here --- src/ConnectionLocator.php | 7 ------- tests/ConnectionLocatorTest.php | 8 -------- 2 files changed, 15 deletions(-) diff --git a/src/ConnectionLocator.php b/src/ConnectionLocator.php index 953dd7f..37b1198 100644 --- a/src/ConnectionLocator.php +++ b/src/ConnectionLocator.php @@ -47,13 +47,6 @@ public static function new(...$args) return new static(Connection::factory(...$args)); } - public static function factory(...$args) - { - return function () use ($args) { - return static::new(...$args); - }; - } - public function __construct( callable $default = null, array $read = [], diff --git a/tests/ConnectionLocatorTest.php b/tests/ConnectionLocatorTest.php index 21a3c94..bd0682e 100644 --- a/tests/ConnectionLocatorTest.php +++ b/tests/ConnectionLocatorTest.php @@ -65,14 +65,6 @@ public function testNewWithPdo() $this->assertSame($pdo, $actual->getDefault()->getPdo()); } - public function testFactory() - { - $factory = ConnectionLocator::factory('sqlite::memory:'); - $actual = $factory(); - $this->assertInstanceOf(ConnectionLocator::CLASS, $actual); - $this->assertInstanceOf(PDO::CLASS, $actual->getDefault()->getPdo()); - } - public function testGetDefault() { $locator = $this->newLocator();