From 32c1fd670f43a28243abf733e0572bb11a51e70c Mon Sep 17 00:00:00 2001 From: Charles Sprayberry Date: Fri, 5 Apr 2024 09:17:06 -0400 Subject: [PATCH] Rename methods to be consistent across connection adapters --- src/AmpPostgresConnectionAdapter.php | 4 ++-- tests/Integration/AmpPostgresConnectionAdapterTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AmpPostgresConnectionAdapter.php b/src/AmpPostgresConnectionAdapter.php index c37b39e..6400354 100644 --- a/src/AmpPostgresConnectionAdapter.php +++ b/src/AmpPostgresConnectionAdapter.php @@ -20,7 +20,7 @@ private function __construct( private readonly Closure $connectionFactory ) {} - public static function newConnectionFromConfig(ConnectionAdapterConfig $config) : self { + public static function fromConnectionConfig(ConnectionAdapterConfig $config) : self { return new self(fn() => connect( PostgresConfig::fromString(sprintf( 'db=%s host=%s port=%d user=%s pass=%s', @@ -33,7 +33,7 @@ public static function newConnectionFromConfig(ConnectionAdapterConfig $config) )); } - public static function existingConnection(PostgresLink $link) : self { + public static function fromExistingConnection(PostgresLink $link) : self { return new self(fn() => $link); } diff --git a/tests/Integration/AmpPostgresConnectionAdapterTest.php b/tests/Integration/AmpPostgresConnectionAdapterTest.php index 2adf338..7f891f3 100644 --- a/tests/Integration/AmpPostgresConnectionAdapterTest.php +++ b/tests/Integration/AmpPostgresConnectionAdapterTest.php @@ -22,6 +22,6 @@ protected function executeCountSql(string $table) : int { } protected static function getConnectionAdapter() : ConnectionAdapter { - return AmpPostgresConnectionAdapter::newConnectionFromConfig(new PostgresConnectionConfig()); + return AmpPostgresConnectionAdapter::fromConnectionConfig(new PostgresConnectionConfig()); } } \ No newline at end of file