diff --git a/src/ProtocolStreamWriter.php b/src/ProtocolStreamWriter.php index f709578..2f91572 100644 --- a/src/ProtocolStreamWriter.php +++ b/src/ProtocolStreamWriter.php @@ -57,7 +57,8 @@ class ProtocolStreamWriter implements ProtocolWriter * * @return void */ - public function writeData() { + public function writeData() + { $message = $this->messages[0]['message']; $promise = $this->messages[0]['promise']; @@ -72,8 +73,7 @@ class ProtocolStreamWriter implements ProtocolWriter } else { throw new RuntimeException('Could not write message'); } - } - else if ($bytesWritten > 0) { + } else if ($bytesWritten > 0) { $message = substr($message, $bytesWritten); } @@ -87,8 +87,7 @@ class ProtocolStreamWriter implements ProtocolWriter } $promise->fulfill(); - } - else { + } else { $this->messages[0]['message'] = $message; } } diff --git a/tests/ProtocolStreamWriterTest.php b/tests/ProtocolStreamWriterTest.php index ff63185..b481c3b 100644 --- a/tests/ProtocolStreamWriterTest.php +++ b/tests/ProtocolStreamWriterTest.php @@ -23,9 +23,9 @@ class ProtocolStreamWriterTest extends TestCase $msgString = (string)$msg; $promise = $writer->write($msg); - $promise->then(function() { + $promise->then(function () { Loop\stop(); - }, function() { + }, function () { Loop\stop(); });