@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->apiCall('rtm.start') |
| 98 | 98 | |
| 99 | 99 | // then connect to the socket... |
| 100 | - ->then(function (Payload $response) { |
|
| 100 | + ->then(function(Payload $response) { |
|
| 101 | 101 | $responseData = $response->getData(); |
| 102 | 102 | // get the team info |
| 103 | 103 | $this->team = new Team($this, $responseData['team']); |
@@ -130,20 +130,20 @@ discard block |
||
| 130 | 130 | }, function($exception) use ($deferred) { |
| 131 | 131 | // if connection was not successful |
| 132 | 132 | $deferred->reject(new ConnectionException( |
| 133 | - 'Could not connect to Slack API: '. $exception->getMessage(), |
|
| 133 | + 'Could not connect to Slack API: '.$exception->getMessage(), |
|
| 134 | 134 | $exception->getCode() |
| 135 | 135 | )); |
| 136 | 136 | }) |
| 137 | 137 | |
| 138 | 138 | // then wait for the connection to be ready. |
| 139 | - ->then(function (WebSocket $socket) use ($deferred) { |
|
| 139 | + ->then(function(WebSocket $socket) use ($deferred) { |
|
| 140 | 140 | $this->websocket = $socket; |
| 141 | 141 | |
| 142 | - $this->once('hello', function () use ($deferred) { |
|
| 142 | + $this->once('hello', function() use ($deferred) { |
|
| 143 | 143 | $deferred->resolve(); |
| 144 | 144 | }); |
| 145 | 145 | |
| 146 | - $this->once('error', function ($data) use ($deferred) { |
|
| 146 | + $this->once('error', function($data) use ($deferred) { |
|
| 147 | 147 | $deferred->reject(new ConnectionException( |
| 148 | 148 | 'Could not connect to WebSocket: '.$data['error']['msg'], |
| 149 | 149 | $data['error']['code'])); |
@@ -293,8 +293,8 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | private function newWebSocket($url) |
| 295 | 295 | { |
| 296 | - return $this->wsFactory->__invoke($url)->then(function (WebSocket $socket) { |
|
| 297 | - $socket->on('message', function ($data) { |
|
| 296 | + return $this->wsFactory->__invoke($url)->then(function(WebSocket $socket) { |
|
| 297 | + $socket->on('message', function($data) { |
|
| 298 | 298 | // parse the message and get the event name |
| 299 | 299 | $this->onMessage(Payload::fromJson($data)); |
| 300 | 300 | }); |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | break; |
| 327 | 327 | |
| 328 | 328 | case 'channel_created': |
| 329 | - $this->getChannelById($payload['channel']['id'])->then(function (Channel $channel) { |
|
| 329 | + $this->getChannelById($payload['channel']['id'])->then(function(Channel $channel) { |
|
| 330 | 330 | $this->channels[$channel->getId()] = $channel; |
| 331 | 331 | }); |
| 332 | 332 | break; |