Skip to content

Commit

Permalink
return basic driver in basic client
Browse files Browse the repository at this point in the history
  • Loading branch information
transistive committed Sep 20, 2023
1 parent d8f8893 commit 87a4d59
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Basic/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace Laudis\Neo4j\Basic;

use Laudis\Neo4j\Contracts\ClientInterface;
use Laudis\Neo4j\Contracts\DriverInterface;
use Laudis\Neo4j\Databags\Statement;
use Laudis\Neo4j\Databags\SummarizedResult;
use Laudis\Neo4j\Databags\TransactionConfiguration;
Expand Down Expand Up @@ -53,9 +52,14 @@ public function beginTransaction(?iterable $statements = null, ?string $alias =
return new UnmanagedTransaction($this->client->beginTransaction($statements, $alias, $config));
}

public function getDriver(?string $alias): DriverInterface
public function getDriver(?string $alias): Driver
{
return $this->client->getDriver($alias);
$driver = $this->client->getDriver($alias);
if ($driver instanceof Driver) {
return $driver;
}

return new Driver($driver);
}

public function hasDriver(string $alias): bool
Expand Down

0 comments on commit 87a4d59

Please sign in to comment.