Completed
Push — master ( 5941b1...265103 )
by Brian
03:27
created
src/wormling/phparia/Api/Channels.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -367,7 +367,7 @@
 block discarded – undo
367 367
      */
368 368
     public function unmute($channelId, $direction)
369 369
     {
370
-        $uri = "/channels/$channelId/mute?direction=".$this->client->getEndpoint()->jsonEncode($direction);
370
+        $uri = "/channels/$channelId/mute?direction=" . $this->client->getEndpoint()->jsonEncode($direction);
371 371
         try {
372 372
             $this->client->getEndpoint()->delete($uri);
373 373
         } catch (Pest_NotFound $e) {
Please login to merge, or discard this patch.
src/wormling/phparia/Client/AmiClient.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -76,18 +76,18 @@
 block discarded – undo
76 76
         $factory = new Factory($this->eventLoop);
77 77
 
78 78
         return $factory->createClient($address)
79
-            ->then(function (Client $client) {
79
+            ->then(function(Client $client) {
80 80
                 $this->amiClient = $client;
81 81
                 $this->actionSender = new ActionSender($client);
82 82
                 $this->actionSender->events(true);
83
-                $client->on('close', function () {
83
+                $client->on('close', function() {
84 84
                     $this->logger->debug('AMI connection closed');
85 85
                 });
86
-                $client->on('event', function (Event $event) {
86
+                $client->on('event', function(Event $event) {
87 87
                     $this->wsClient->emit($event->getName(), (array)$event);
88 88
                 });
89
-            }, function (\Exception $e) {
90
-                $this->logger->err('Connection error: '.$e->getMessage());
89
+            }, function(\Exception $e) {
90
+                $this->logger->err('Connection error: ' . $e->getMessage());
91 91
             });
92 92
     }
93 93
 
Please login to merge, or discard this patch.
src/wormling/phparia/Client/AriClient.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -148,15 +148,15 @@
 block discarded – undo
148 148
         $apiKey = $queryParts['api_key'];
149 149
         list($username, $password) = explode(':', $apiKey);
150 150
 
151
-        $this->endpoint = new PestJSON('http://'.$host.':'.$port.dirname($path));
151
+        $this->endpoint = new PestJSON('http://' . $host . ':' . $port . dirname($path));
152 152
         $this->endpoint->setupAuth($username, $password, 'basic');
153 153
 
154 154
         $this->wsClient = new WebSocket($address, $this->eventLoop, $this->logger);
155 155
 
156
-        $this->wsClient->on("message", function (WebSocketMessage $rawMessage) {
156
+        $this->wsClient->on("message", function(WebSocketMessage $rawMessage) {
157 157
             $message = new Message($rawMessage->getData());
158 158
 
159
-            $eventType = '\\phparia\\Events\\'.$message->getType();
159
+            $eventType = '\\phparia\\Events\\' . $message->getType();
160 160
             if (class_exists($eventType)) {
161 161
                 $event = new $eventType($this, $rawMessage->getData());
162 162
             } else {
Please login to merge, or discard this patch.
src/wormling/phparia/Resources/Bridge.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     public function onBridgeCreated(callable $callback)
132 132
     {
133
-        $this->on(Event::BRIDGE_CREATED.'_'.$this->getId(), $callback);
133
+        $this->on(Event::BRIDGE_CREATED . '_' . $this->getId(), $callback);
134 134
     }
135 135
 
136 136
     /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
      */
139 139
     public function onceBridgeCreated(callable $callback)
140 140
     {
141
-        $this->once(Event::BRIDGE_CREATED.'_'.$this->getId(), $callback);
141
+        $this->once(Event::BRIDGE_CREATED . '_' . $this->getId(), $callback);
142 142
     }
143 143
 
144 144
     /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public function onBridgeDestroyed(callable $callback)
148 148
     {
149
-        $this->on(Event::BRIDGE_DESTROYED.'_'.$this->getId(), $callback);
149
+        $this->on(Event::BRIDGE_DESTROYED . '_' . $this->getId(), $callback);
150 150
     }
151 151
 
152 152
     /**
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
      */
155 155
     public function onceBridgeDestroyed(callable $callback)
156 156
     {
157
-        $this->once(Event::BRIDGE_DESTROYED.'_'.$this->getId(), $callback);
157
+        $this->once(Event::BRIDGE_DESTROYED . '_' . $this->getId(), $callback);
158 158
     }
159 159
 
160 160
     /**
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function onBridgeMerged(callable $callback)
164 164
     {
165
-        $this->on(Event::BRIDGE_MERGED.'_'.$this->getId(), $callback);
165
+        $this->on(Event::BRIDGE_MERGED . '_' . $this->getId(), $callback);
166 166
     }
167 167
 
168 168
     /**
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      */
171 171
     public function onceBridgeMerged(callable $callback)
172 172
     {
173
-        $this->once(Event::BRIDGE_MERGED.'_'.$this->getId(), $callback);
173
+        $this->once(Event::BRIDGE_MERGED . '_' . $this->getId(), $callback);
174 174
     }
175 175
 
176 176
     /**
Please login to merge, or discard this patch.
src/wormling/phparia/Resources/Resource.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
      */
63 63
     public function once($event, callable $listener)
64 64
     {
65
-        $onceListener = function () use (&$onceListener, $event, $listener) {
65
+        $onceListener = function() use (&$onceListener, $event, $listener) {
66 66
             $this->removeListener($event, $onceListener);
67 67
 
68 68
             call_user_func_array($listener, func_get_args());
Please login to merge, or discard this patch.
phpunit_bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$loader = @include __DIR__.'/vendor/autoload.php';
3
+$loader = @include __DIR__ . '/vendor/autoload.php';
4 4
 if (!$loader) {
5
-    $loader = require __DIR__.'./vendor/autoload.php';
5
+    $loader = require __DIR__ . './vendor/autoload.php';
6 6
 }
7 7
 $loader->addPsr4('phparia\\Tests\\Functional\\', __DIR__);
Please login to merge, or discard this patch.
src/wormling/phparia/Api/Applications.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
      */
116 116
     public function unsubscribe($applicationName, $eventSource)
117 117
     {
118
-        $uri = "/applications/$applicationName/subscription?eventSource=".$this->client->getEndpoint()->jsonEncode($eventSource);
118
+        $uri = "/applications/$applicationName/subscription?eventSource=" . $this->client->getEndpoint()->jsonEncode($eventSource);
119 119
         try {
120 120
             $response = $this->client->getEndpoint()->delete($uri);
121 121
         } catch (Pest_BadRequest $e) { // Missing parameter; event source scheme not recognized.
Please login to merge, or discard this patch.
src/wormling/phparia/Resources/Application.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function onApplicationReplaced(callable $callback)
100 100
     {
101
-        $this->on(Event::APPLICATION_REPLACED.'_'.$this->getName(), $callback);
101
+        $this->on(Event::APPLICATION_REPLACED . '_' . $this->getName(), $callback);
102 102
     }
103 103
 
104 104
     /**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function onceApplicationReplaced(callable $callback)
108 108
     {
109
-        $this->once(Event::APPLICATION_REPLACED.'_'.$this->getName(), $callback);
109
+        $this->once(Event::APPLICATION_REPLACED . '_' . $this->getName(), $callback);
110 110
     }
111 111
 
112 112
     /**
Please login to merge, or discard this patch.
src/wormling/phparia/Resources/Channel.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function onStasisEnd(callable $callback)
144 144
     {
145
-        $this->on(Event::STASIS_END.'_'.$this->getId(), $callback);
145
+        $this->on(Event::STASIS_END . '_' . $this->getId(), $callback);
146 146
     }
147 147
 
148 148
     /**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function onceStasisEnd(callable $callback)
152 152
     {
153
-        $this->once(Event::STASIS_END.'_'.$this->getId(), $callback);
153
+        $this->once(Event::STASIS_END . '_' . $this->getId(), $callback);
154 154
     }
155 155
 
156 156
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function onStasisStart(callable $callback)
160 160
     {
161
-        $this->on(Event::STASIS_START.'_'.$this->getId(), $callback);
161
+        $this->on(Event::STASIS_START . '_' . $this->getId(), $callback);
162 162
     }
163 163
 
164 164
     /**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     public function onceStasisStart(callable $callback)
168 168
     {
169
-        $this->once(Event::STASIS_START.'_'.$this->getId(), $callback);
169
+        $this->once(Event::STASIS_START . '_' . $this->getId(), $callback);
170 170
     }
171 171
 
172 172
     /**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      */
175 175
     public function onChannelCallerId(callable $callback)
176 176
     {
177
-        $this->on(Event::CHANNEL_CALLER_ID.'_'.$this->getId(), $callback);
177
+        $this->on(Event::CHANNEL_CALLER_ID . '_' . $this->getId(), $callback);
178 178
     }
179 179
 
180 180
     /**
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
      */
183 183
     public function onceChannelCallerId(callable $callback)
184 184
     {
185
-        $this->once(Event::CHANNEL_CALLER_ID.'_'.$this->getId(), $callback);
185
+        $this->once(Event::CHANNEL_CALLER_ID . '_' . $this->getId(), $callback);
186 186
     }
187 187
 
188 188
     /**
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      */
191 191
     public function onChannelCreated(callable $callback)
192 192
     {
193
-        $this->on(Event::CHANNEL_CREATED.'_'.$this->getId(), $callback);
193
+        $this->on(Event::CHANNEL_CREATED . '_' . $this->getId(), $callback);
194 194
     }
195 195
 
196 196
     /**
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
      */
199 199
     public function onceChannelCreated(callable $callback)
200 200
     {
201
-        $this->once(Event::CHANNEL_CREATED.'_'.$this->getId(), $callback);
201
+        $this->once(Event::CHANNEL_CREATED . '_' . $this->getId(), $callback);
202 202
     }
203 203
 
204 204
     /**
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
      */
207 207
     public function onChannelDestroyed(callable $callback)
208 208
     {
209
-        $this->on(Event::CHANNEL_DESTROYED.'_'.$this->getId(), $callback);
209
+        $this->on(Event::CHANNEL_DESTROYED . '_' . $this->getId(), $callback);
210 210
     }
211 211
 
212 212
     /**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
      */
215 215
     public function onceChannelDestroyed(callable $callback)
216 216
     {
217
-        $this->once(Event::CHANNEL_DESTROYED.'_'.$this->getId(), $callback);
217
+        $this->once(Event::CHANNEL_DESTROYED . '_' . $this->getId(), $callback);
218 218
     }
219 219
 
220 220
     /**
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      */
223 223
     public function removeChannelDestroyedListener(callable $callback)
224 224
     {
225
-        $this->removeListener(Event::CHANNEL_DESTROYED.'_'.$this->getId(), $callback);
225
+        $this->removeListener(Event::CHANNEL_DESTROYED . '_' . $this->getId(), $callback);
226 226
     }
227 227
 
228 228
     /**
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      */
231 231
     public function onChannelDtmfReceived(callable $callback)
232 232
     {
233
-        $this->on(Event::CHANNEL_DTMF_RECEIVED.'_'.$this->getId(), $callback);
233
+        $this->on(Event::CHANNEL_DTMF_RECEIVED . '_' . $this->getId(), $callback);
234 234
     }
235 235
 
236 236
     /**
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      */
239 239
     public function onceChannelDtmfReceived(callable $callback)
240 240
     {
241
-        $this->once(Event::CHANNEL_DTMF_RECEIVED.'_'.$this->getId(), $callback);
241
+        $this->once(Event::CHANNEL_DTMF_RECEIVED . '_' . $this->getId(), $callback);
242 242
     }
243 243
 
244 244
     /**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
      */
247 247
     public function onChannelEnteredBridge(callable $callback)
248 248
     {
249
-        $this->on(Event::CHANNEL_ENTERED_BRIDGE.'_'.$this->getId(), $callback);
249
+        $this->on(Event::CHANNEL_ENTERED_BRIDGE . '_' . $this->getId(), $callback);
250 250
     }
251 251
 
252 252
     /**
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      */
255 255
     public function onceChannelEnteredBridge(callable $callback)
256 256
     {
257
-        $this->once(Event::CHANNEL_ENTERED_BRIDGE.'_'.$this->getId(), $callback);
257
+        $this->once(Event::CHANNEL_ENTERED_BRIDGE . '_' . $this->getId(), $callback);
258 258
     }
259 259
 
260 260
     /**
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      */
263 263
     public function onChannelHangupRequest(callable $callback)
264 264
     {
265
-        $this->on(Event::CHANNEL_HANGUP_REQUEST.'_'.$this->getId(), $callback);
265
+        $this->on(Event::CHANNEL_HANGUP_REQUEST . '_' . $this->getId(), $callback);
266 266
     }
267 267
 
268 268
     /**
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
      */
271 271
     public function onceChannelHangupRequest(callable $callback)
272 272
     {
273
-        $this->once(Event::CHANNEL_HANGUP_REQUEST.'_'.$this->getId(), $callback);
273
+        $this->once(Event::CHANNEL_HANGUP_REQUEST . '_' . $this->getId(), $callback);
274 274
     }
275 275
 
276 276
     /**
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      */
279 279
     public function onChannelLeftBridge(callable $callback)
280 280
     {
281
-        $this->on(Event::CHANNEL_LEFT_BRIDGE.'_'.$this->getId(), $callback);
281
+        $this->on(Event::CHANNEL_LEFT_BRIDGE . '_' . $this->getId(), $callback);
282 282
     }
283 283
 
284 284
     /**
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      */
287 287
     public function onceChannelLeftBridge(callable $callback)
288 288
     {
289
-        $this->once(Event::CHANNEL_LEFT_BRIDGE.'_'.$this->getId(), $callback);
289
+        $this->once(Event::CHANNEL_LEFT_BRIDGE . '_' . $this->getId(), $callback);
290 290
     }
291 291
 
292 292
     /**
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      */
295 295
     public function onChannelStateChange(callable $callback)
296 296
     {
297
-        $this->on(Event::CHANNEL_STATE_CHANGED.'_'.$this->getId(), $callback);
297
+        $this->on(Event::CHANNEL_STATE_CHANGED . '_' . $this->getId(), $callback);
298 298
     }
299 299
 
300 300
     /**
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public function onceChannelStateChange(callable $callback)
304 304
     {
305
-        $this->once(Event::CHANNEL_STATE_CHANGED.'_'.$this->getId(), $callback);
305
+        $this->once(Event::CHANNEL_STATE_CHANGED . '_' . $this->getId(), $callback);
306 306
     }
307 307
 
308 308
     /**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      */
311 311
     public function onChannelTalkingFinished(callable $callback)
312 312
     {
313
-        $this->on(Event::CHANNEL_TALKING_FINISHED.'_'.$this->getId(), $callback);
313
+        $this->on(Event::CHANNEL_TALKING_FINISHED . '_' . $this->getId(), $callback);
314 314
     }
315 315
 
316 316
     /**
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
      */
319 319
     public function onceChannelTalkingFinished(callable $callback)
320 320
     {
321
-        $this->once(Event::CHANNEL_TALKING_FINISHED.'_'.$this->getId(), $callback);
321
+        $this->once(Event::CHANNEL_TALKING_FINISHED . '_' . $this->getId(), $callback);
322 322
     }
323 323
 
324 324
     /**
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
      */
327 327
     public function onChannelTalkingStarted(callable $callback)
328 328
     {
329
-        $this->on(Event::CHANNEL_TALKING_STARTED.'_'.$this->getId(), $callback);
329
+        $this->on(Event::CHANNEL_TALKING_STARTED . '_' . $this->getId(), $callback);
330 330
     }
331 331
 
332 332
     /**
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      */
335 335
     public function onceChannelTalkingStarted(callable $callback)
336 336
     {
337
-        $this->once(Event::CHANNEL_TALKING_STARTED.'_'.$this->getId(), $callback);
337
+        $this->once(Event::CHANNEL_TALKING_STARTED . '_' . $this->getId(), $callback);
338 338
     }
339 339
 
340 340
     /**
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
      */
343 343
     public function onChannelUserevent(callable $callback)
344 344
     {
345
-        $this->on(Event::CHANNEL_USEREVENT.'_'.$this->getId(), $callback);
345
+        $this->on(Event::CHANNEL_USEREVENT . '_' . $this->getId(), $callback);
346 346
     }
347 347
 
348 348
     /**
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
      */
351 351
     public function onceChannelUserevent(callable $callback)
352 352
     {
353
-        $this->once(Event::CHANNEL_USEREVENT.'_'.$this->getId(), $callback);
353
+        $this->once(Event::CHANNEL_USEREVENT . '_' . $this->getId(), $callback);
354 354
     }
355 355
 
356 356
     /**
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
      */
359 359
     public function onChannelVarset(callable $callback)
360 360
     {
361
-        $this->on(Event::CHANNEL_VARSET.'_'.$this->getId(), $callback);
361
+        $this->on(Event::CHANNEL_VARSET . '_' . $this->getId(), $callback);
362 362
     }
363 363
 
364 364
     /**
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
      */
367 367
     public function onceChannelVarset(callable $callback)
368 368
     {
369
-        $this->once(Event::CHANNEL_VARSET.'_'.$this->getId(), $callback);
369
+        $this->once(Event::CHANNEL_VARSET . '_' . $this->getId(), $callback);
370 370
     }
371 371
 
372 372
     /**
Please login to merge, or discard this patch.