@@ -233,7 +233,9 @@ discard block |
||
| 233 | 233 | } else { |
| 234 | 234 | $tokens = $line; |
| 235 | 235 | } |
| 236 | - if ($this->debug) echo "<< ".$line."\n"; |
|
| 236 | + if ($this->debug) { |
|
| 237 | + echo "<< ".$line."\n"; |
|
| 238 | + } |
|
| 237 | 239 | |
| 238 | 240 | // if tag is wanted tag we might be at the end of a multiline response |
| 239 | 241 | return $tag == $wantedTag; |
@@ -298,7 +300,9 @@ discard block |
||
| 298 | 300 | $line .= ' ' . $token; |
| 299 | 301 | } |
| 300 | 302 | } |
| 301 | - if ($this->debug) echo ">> ".$line."\n"; |
|
| 303 | + if ($this->debug) { |
|
| 304 | + echo ">> ".$line."\n"; |
|
| 305 | + } |
|
| 302 | 306 | |
| 303 | 307 | if (fwrite($this->stream, $line . "\r\n") === false) { |
| 304 | 308 | throw new RuntimeException('failed to write - connection closed?'); |
@@ -448,7 +452,9 @@ discard block |
||
| 448 | 452 | public function getCapabilities() { |
| 449 | 453 | $response = $this->requestAndResponse('CAPABILITY'); |
| 450 | 454 | |
| 451 | - if (!$response) return []; |
|
| 455 | + if (!$response) { |
|
| 456 | + return []; |
|
| 457 | + } |
|
| 452 | 458 | |
| 453 | 459 | $capabilities = []; |
| 454 | 460 | foreach ($response as $line) { |
@@ -605,13 +611,14 @@ discard block |
||
| 605 | 611 | // if we want only one message we can ignore everything else and just return |
| 606 | 612 | if ($to === null && !is_array($from) && ($uid ? $tokens[2][$uidKey] == $from : $tokens[0] == $from)) { |
| 607 | 613 | // we still need to read all lines |
| 608 | - while (!$this->readLine($tokens, $tag)) |
|
| 609 | - |
|
| 614 | + while (!$this->readLine($tokens, $tag)) { |
|
| 615 | + |
|
| 610 | 616 | return $data; |
| 617 | + } |
|
| 611 | 618 | } |
| 612 | 619 | if ($uid) { |
| 613 | 620 | $result[$tokens[2][$uidKey]] = $data; |
| 614 | - }else{ |
|
| 621 | + } else{ |
|
| 615 | 622 | $result[$tokens[0]] = $data; |
| 616 | 623 | } |
| 617 | 624 | } |