@@ -98,13 +98,13 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | public function setMessageHandler($messageHandler) |
| 100 | 100 | { |
| 101 | - if (!$messageHandler instanceof MessageHandlerInterface && !\is_string($messageHandler)) { |
|
| 101 | + if (!$messageHandler instanceof MessageHandlerInterface && !\is_string($messageHandler)) { |
|
| 102 | 102 | throw new \InvalidArgumentException('The message handler must be an instance of MessageHandlerInterface or a string.'); |
| 103 | 103 | } |
| 104 | 104 | if (\is_string($messageHandler)) { |
| 105 | 105 | try { |
| 106 | 106 | $reflection = new \ReflectionClass($messageHandler); |
| 107 | - if(!$reflection->implementsInterface('Nekland\Woketo\Message\MessageHandlerInterface')) { |
|
| 107 | + if (!$reflection->implementsInterface('Nekland\Woketo\Message\MessageHandlerInterface')) { |
|
| 108 | 108 | throw new \InvalidArgumentException('The messageHandler must implement MessageHandlerInterface'); |
| 109 | 109 | } |
| 110 | 110 | } catch (\ReflectionException $e) { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $this->loop = \React\EventLoop\Factory::create(); |
| 121 | 121 | |
| 122 | 122 | $socket = new \React\Socket\Server($this->loop); |
| 123 | - $socket->on('connection', function ($socketStream) { |
|
| 123 | + $socket->on('connection', function($socketStream) { |
|
| 124 | 124 | $this->onNewConnection($socketStream); |
| 125 | 125 | }); |
| 126 | 126 | $socket->listen($this->port); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | public function add(string $name, $value) |
| 64 | 64 | { |
| 65 | 65 | if (!empty($this->headers[$name])) { |
| 66 | - if (!\is_array($this->headers[$name])){ |
|
| 66 | + if (!\is_array($this->headers[$name])) { |
|
| 67 | 67 | $this->headers[$name] = [$this->headers[$name]]; |
| 68 | 68 | } |
| 69 | 69 | $this->headers[$name][] = $value; |