Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bolt protocol disconnect packet not sent upon object destroy #195

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Bolt/BoltConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
*/
public function isOpen(): bool
{
return in_array($this->protocol()->serverState->get(), ['DISCONNECTED', 'DEFUNCT'], true);
return !in_array($this->protocol()->serverState->get(), ['DISCONNECTED', 'DEFUNCT'], true);
}

public function setTimeout(float $timeout): void
Expand Down Expand Up @@ -296,10 +296,10 @@
private function buildRunExtra(?string $database, ?float $timeout, BookmarkHolder $holder, ?AccessMode $mode): array
{
$extra = [];
if ($database) {

Check failure on line 299 in src/Bolt/BoltConnection.php

View workflow job for this annotation

GitHub Actions / Lint & Analyse

RiskyTruthyFalsyComparison

src/Bolt/BoltConnection.php:299:13: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
$extra['db'] = $database;
}
if ($timeout) {

Check failure on line 302 in src/Bolt/BoltConnection.php

View workflow job for this annotation

GitHub Actions / Lint & Analyse

RiskyTruthyFalsyComparison

src/Bolt/BoltConnection.php:302:13: RiskyTruthyFalsyComparison: Operand of type float|null contains type float, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
$extra['tx_timeout'] = (int) ($timeout * 1000);
}

Expand Down
Loading