Completed
Push — master ( 0326f5...bed48d )
by Kamil
02:37
created
src/Socket/SocketListener.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     {
204 204
         $endpoint = explode('://', $this->getLocalEndpoint(), 2);
205 205
 
206
-        return isset($endpoint[0]) ? $endpoint[0]:'';
206
+        return isset($endpoint[0]) ? $endpoint[0] : '';
207 207
     }
208 208
 
209 209
     /**
@@ -299,9 +299,9 @@  discard block
 block discarded – undo
299 299
 
300 300
         $this->started = false;
301 301
 
302
-        $this->emit('close', [ $this ]);
302
+        $this->emit('close', [$this]);
303 303
         $this->handleClose();
304
-        $this->emit('done', [ $this ]);
304
+        $this->emit('done', [$this]);
305 305
     }
306 306
 
307 307
     /**
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 
334 334
             if (isset($this->loop))
335 335
             {
336
-                $this->loop->addReadStream($this->socket, [ $this, 'handleConnect' ]);
336
+                $this->loop->addReadStream($this->socket, [$this, 'handleConnect']);
337 337
             }
338 338
         }
339 339
     }
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 
461 461
         if ($socket === false)
462 462
         {
463
-            $this->emit('error', [ $this, new ReadException('Socket could not accept new connection.') ]);
463
+            $this->emit('error', [$this, new ReadException('Socket could not accept new connection.')]);
464 464
             return;
465 465
         }
466 466
 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                 'ssl_method' => $this->config['ssl_method'],
475 475
             ]);
476 476
 
477
-            $this->emit('connect', [ $this, $client ]);
477
+            $this->emit('connect', [$this, $client]);
478 478
         }
479 479
         catch (Error $ex)
480 480
         {}
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
         if ($ex !== null)
485 485
         {
486 486
             $this->handleDisconnect($socket);
487
-            $this->emit('error', [ $this, new ReadException('Socket could not wrap new connection!') ]);
487
+            $this->emit('error', [$this, new ReadException('Socket could not wrap new connection!')]);
488 488
         }
489 489
     }
490 490
 
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
                         $count = count($parts);
573 573
                         $port = $parts[$count - 1];
574 574
                         unset($parts[$count - 1]);
575
-                        $endpoint = $transport.'[' . implode(':', $parts) . ']:' . $port;
575
+                        $endpoint = $transport . '[' . implode(':', $parts) . ']:' . $port;
576 576
                     }
577 577
                     else
578 578
                     {
Please login to merge, or discard this patch.
src/Socket/Socket.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         if ($ex !== null)
355 355
         {
356 356
             $this->close();
357
-            $this->emit('error', [ $this, $ex ]);
357
+            $this->emit('error', [$this, $ex]);
358 358
         }
359 359
     }
360 360
 
@@ -373,8 +373,8 @@  discard block
 block discarded – undo
373 373
 
374 374
             if ($data !== '' && $data !== false)
375 375
             {
376
-                $this->emit('data', [ $this, $data ]);
377
-                $this->emit('end', [ $this ]);
376
+                $this->emit('data', [$this, $data]);
377
+                $this->emit('end', [$this]);
378 378
             }
379 379
 
380 380
             if ($data === '' || $data === false || !is_resource($this->resource) || feof($this->resource))
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 
390 390
         if ($ex !== null)
391 391
         {
392
-            $this->emit('error', [ $this, $ex ]);
392
+            $this->emit('error', [$this, $ex]);
393 393
         }
394 394
     }
395 395
 
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 
414 414
         if ($ex !== null)
415 415
         {
416
-            $this->emit('error', [ $this, $ex ]);
416
+            $this->emit('error', [$this, $ex]);
417 417
         }
418 418
     }
419 419
 
@@ -443,8 +443,8 @@  discard block
 block discarded – undo
443 443
     protected function getHandleReadFunction()
444 444
     {
445 445
         return $this->config['ssl'] === true && !$this->isEncrypted()
446
-            ? [ $this, 'handleEncrypt' ]
447
-            : [ $this, 'handleRead' ];
446
+            ? [$this, 'handleEncrypt']
447
+            : [$this, 'handleRead'];
448 448
     }
449 449
 
450 450
     /**
@@ -455,8 +455,8 @@  discard block
 block discarded – undo
455 455
     protected function getHandleWriteFunction()
456 456
     {
457 457
         return $this->config['ssl'] === true && !$this->isEncrypted()
458
-            ? [ $this, 'handleEncrypt' ]
459
-            : [ $this, 'handleWrite' ];
458
+            ? [$this, 'handleEncrypt']
459
+            : [$this, 'handleWrite'];
460 460
     }
461 461
 
462 462
     /**
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
      */
494 494
     private function parseEndpoint($wantPeer = false)
495 495
     {
496
-        $wantIndex = (int)$wantPeer;
496
+        $wantIndex = (int) $wantPeer;
497 497
 
498 498
         if (isset($this->cachedEndpoint[$wantIndex]))
499 499
         {
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
                     $count = count($parts);
524 524
                     $port = $parts[$count - 1];
525 525
                     unset($parts[$count - 1]);
526
-                    $endpoint = $transport.'[' . implode(':', $parts) . ']:' . $port;
526
+                    $endpoint = $transport . '[' . implode(':', $parts) . ']:' . $port;
527 527
                 }
528 528
                 else
529 529
                 {
Please login to merge, or discard this patch.