1
0
Fork 0

Style fixes.

pull/112/head
Stephan Unverwerth 2016-10-25 01:41:36 +02:00
parent 1d949b9282
commit 55913eba79
2 changed files with 6 additions and 7 deletions

View File

@ -57,7 +57,8 @@ class ProtocolStreamWriter implements ProtocolWriter
* *
* @return void * @return void
*/ */
public function writeData() { public function writeData()
{
$message = $this->messages[0]['message']; $message = $this->messages[0]['message'];
$promise = $this->messages[0]['promise']; $promise = $this->messages[0]['promise'];
@ -72,8 +73,7 @@ class ProtocolStreamWriter implements ProtocolWriter
} else { } else {
throw new RuntimeException('Could not write message'); throw new RuntimeException('Could not write message');
} }
} } else if ($bytesWritten > 0) {
else if ($bytesWritten > 0) {
$message = substr($message, $bytesWritten); $message = substr($message, $bytesWritten);
} }
@ -87,8 +87,7 @@ class ProtocolStreamWriter implements ProtocolWriter
} }
$promise->fulfill(); $promise->fulfill();
} } else {
else {
$this->messages[0]['message'] = $message; $this->messages[0]['message'] = $message;
} }
} }

View File

@ -23,9 +23,9 @@ class ProtocolStreamWriterTest extends TestCase
$msgString = (string)$msg; $msgString = (string)$msg;
$promise = $writer->write($msg); $promise = $writer->write($msg);
$promise->then(function() { $promise->then(function () {
Loop\stop(); Loop\stop();
}, function() { }, function () {
Loop\stop(); Loop\stop();
}); });