Skip to content

Commit c411c8f

Browse files
committed
uniform interface inheritance for running queries
1 parent 92df0ff commit c411c8f

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public function __construct(CypherMap $driverSetups, DriverConfiguration $defaul
6060
$this->defaultTransactionConfiguration = $defaultTransactionConfiguration;
6161
}
6262

63-
public function run(string $query, iterable $parameters = [], ?string $alias = null)
63+
public function run(string $statement, iterable $parameters = [], ?string $alias = null)
6464
{
65-
return $this->runStatement(Statement::create($query, $parameters), $alias);
65+
return $this->runStatement(Statement::create($statement, $parameters), $alias);
6666
}
6767

6868
public function runStatement(Statement $statement, ?string $alias = null)

src/Contracts/ClientInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020

2121
/**
2222
* @template ResultFormat
23+
*
24+
* @extends TransactionInterface<ResultFormat>
2325
*/
24-
interface ClientInterface
26+
interface ClientInterface extends TransactionInterface
2527
{
2628
/**
2729
* Runs a one off transaction with the provided query and parameters over the connection with the provided alias or the master alias otherwise.
@@ -32,7 +34,7 @@ interface ClientInterface
3234
*
3335
* @return ResultFormat
3436
*/
35-
public function run(string $query, iterable $parameters = [], ?string $alias = null);
37+
public function run(string $statement, iterable $parameters = [], ?string $alias = null);
3638

3739
/**
3840
* Runs a one off transaction with the provided statement over the connection with the provided alias or the master alias otherwise.

src/Contracts/SessionInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
* A lightweight container for causally chained sequences of transactions to carry out work.
2323
*
2424
* @template ResultFormat
25+
*
26+
* @extends TransactionInterface<ResultFormat>
2527
*/
26-
interface SessionInterface
28+
interface SessionInterface extends TransactionInterface
2729
{
2830
/**
2931
* @param iterable<Statement> $statements

0 commit comments

Comments
 (0)