From 1fb1722f49128190cc17dd259587a1fd909aa1cd Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Thu, 29 Sep 2016 20:39:42 +0200 Subject: [PATCH] Suppress fwrite() notice when not all bytes could be written. --- src/ProtocolStreamWriter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProtocolStreamWriter.php b/src/ProtocolStreamWriter.php index 643e940..4d0a98c 100644 --- a/src/ProtocolStreamWriter.php +++ b/src/ProtocolStreamWriter.php @@ -30,7 +30,7 @@ class ProtocolStreamWriter implements ProtocolWriter $totalBytesWritten = 0; while ($totalBytesWritten < $msgSize) { - $bytesWritten = fwrite($this->output, substr($data, $totalBytesWritten)); + $bytesWritten = @fwrite($this->output, substr($data, $totalBytesWritten)); if ($bytesWritten === false) { throw new Error('Could not write message.'); }