Skip to content

Commit 9c3fb1b

Browse files
committed
remove: if check for server state
1 parent 5763131 commit 9c3fb1b

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/Bolt/BoltConnection.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,6 @@ public function begin(?string $database, ?float $timeout, BookmarkHolder $holder
201201
*/
202202
public function discard(?int $qid): void
203203
{
204-
if (!in_array($this->protocol()->serverState, [ServerState::STREAMING, ServerState::TX_STREAMING], true)) {
205-
throw new Neo4jException([Neo4jError::fromMessageAndCode('Neo.ClientError.Request.Invalid', 'Message \'DISCARD\' cannot be handled by a session which isn\'t in the STREAMING|TX_STREAMING state.')]);
206-
}
207-
208204
$extra = $this->buildResultExtra(null, $qid);
209205
$response = $this->protocol()
210206
->discard($extra)
@@ -221,10 +217,6 @@ public function discard(?int $qid): void
221217
*/
222218
public function run(string $text, array $parameters, ?string $database, ?float $timeout, BookmarkHolder $holder, ?AccessMode $mode): array
223219
{
224-
if (!in_array($this->protocol()->serverState, [ServerState::READY, ServerState::TX_READY, ServerState::TX_STREAMING], true)) {
225-
throw new Neo4jException([Neo4jError::fromMessageAndCode('Neo.ClientError.Request.Invalid', 'Message \'RUN\' cannot be handled by a session which isn\'t in the READY|TX_READY|TX_STREAMING state.')]);
226-
}
227-
228220
$extra = $this->buildRunExtra($database, $timeout, $holder, $mode);
229221
$response = $this->protocol()
230222
->run($text, $parameters, $extra)
@@ -243,10 +235,6 @@ public function commit(): void
243235
{
244236
$this->consumeResults();
245237

246-
if ($this->protocol()->serverState !== ServerState::TX_READY) {
247-
throw new Neo4jException([Neo4jError::fromMessageAndCode('Neo.ClientError.Request.Invalid', 'Message \'COMMIT\' cannot be handled by a session which isn\'t in the TX_READY state.')]);
248-
}
249-
250238
$response = $this->protocol()
251239
->commit()
252240
->getResponse();
@@ -286,10 +274,6 @@ public function protocol(): V4_4|V5|V5_3|V5_4
286274
*/
287275
public function pull(?int $qid, ?int $fetchSize): array
288276
{
289-
if (!in_array($this->protocol()->serverState, [ServerState::STREAMING, ServerState::TX_STREAMING], true)) {
290-
throw new Neo4jException([Neo4jError::fromMessageAndCode('Neo.ClientError.Request.Invalid', 'Message \'PULL\' cannot be handled by a session which isn\'t in the STREAMING|TX_STREAMING state.')]);
291-
}
292-
293277
$extra = $this->buildResultExtra($fetchSize, $qid);
294278

295279
$tbr = [];

0 commit comments

Comments
 (0)