Skip to content

Commit

Permalink
Rename methods to be consistent across connection adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
cspray committed Apr 5, 2024
1 parent fa5d4a6 commit 32c1fd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/AmpPostgresConnectionAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/AmpPostgresConnectionAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

0 comments on commit 32c1fd6

Please sign in to comment.