Skip to content

Commit 5cf45c7

Browse files
committed
Length in write has only been nullable since PHP8.0.
1 parent d6076a2 commit 5cf45c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Query/TcpTransportExecutor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ public function handleWritable()
270270
$errstr = isset($m[2]) ? $m[2] : $error;
271271
});
272272

273-
$written = \fwrite($this->socket, $this->writeBuffer, $this->writeChunk);
273+
if ($this->writeChunk !== null) {
274+
$written = \fwrite($this->socket, $this->writeBuffer, $this->writeChunk);
275+
} else {
276+
$written = \fwrite($this->socket, $this->writeBuffer);
277+
}
274278

275279
// Only report errors if *nothing* could be sent and an error has been raised, or we are unable to retrieve the remote socket name (connection dead) [HHVM].
276280
// Ignore non-fatal warnings if *some* data could be sent.

0 commit comments

Comments
 (0)