From 0a9b77fbf8b63c758ddce5c11f5ed91a37c48ce9 Mon Sep 17 00:00:00 2001 From: walkor Date: Tue, 27 Dec 2016 23:31:53 +0800 Subject: [PATCH] fix #58 --- src/Engine/Engine.php | 8 ++++---- src/Engine/Socket.php | 10 ++++++---- src/Engine/Transport.php | 14 +++++++------- src/Nsp.php | 28 ++++++++++++++-------------- src/Parser/Decoder.php | 16 ++++++++-------- src/Parser/Encoder.php | 16 ++++++++-------- src/Socket.php | 10 +++++----- 7 files changed, 52 insertions(+), 50 deletions(-) diff --git a/src/Engine/Engine.php b/src/Engine/Engine.php index e4a04d9..01a8716 100644 --- a/src/Engine/Engine.php +++ b/src/Engine/Engine.php @@ -55,10 +55,10 @@ public function __construct($opts = array()) Debug::debug('Engine __construct'); } -public function __destruct() -{ - Debug::debug('Engine __destruct'); -} + public function __destruct() + { + Debug::debug('Engine __destruct'); + } public function handleRequest($req, $res) { diff --git a/src/Engine/Socket.php b/src/Engine/Socket.php index fde9343..3485104 100644 --- a/src/Engine/Socket.php +++ b/src/Engine/Socket.php @@ -29,10 +29,12 @@ public function __construct($id, $server, $transport, $req) $this->onOpen(); Debug::debug('Engine/Socket __construct'); } -public function __destruct() -{ - Debug::debug('Engine/Socket __destruct'); -} + + public function __destruct() + { + Debug::debug('Engine/Socket __destruct'); + } + public function maybeUpgrade($transport) { $this->upgrading = true; diff --git a/src/Engine/Transport.php b/src/Engine/Transport.php index a42c6f9..0653f35 100644 --- a/src/Engine/Transport.php +++ b/src/Engine/Transport.php @@ -9,14 +9,14 @@ class Transport extends Emitter public $res = null; public function __construct() -{ - Debug::debug('Transport __construct no access !!!!'); -} + { + Debug::debug('Transport __construct no access !!!!'); + } -public function __destruct() -{ - Debug::debug('Transport __destruct'); -} + public function __destruct() + { + Debug::debug('Transport __destruct'); + } public function noop() { diff --git a/src/Nsp.php b/src/Nsp.php index 541c211..e99dba6 100644 --- a/src/Nsp.php +++ b/src/Nsp.php @@ -29,10 +29,10 @@ public function __construct($server, $name) Debug::debug('Nsp __construct'); } -public function __destruct() -{ - Debug::debug('Nsp __destruct'); -} + public function __destruct() + { + Debug::debug('Nsp __destruct'); + } public function initAdapter() { @@ -74,10 +74,10 @@ public function add($client, $nsp, $fn) /** - * Removes a client. Called by each `Socket`. - * - * @api private - */ + * Removes a client. Called by each `Socket`. + * + * @api private + */ public function remove($socket) { @@ -86,12 +86,12 @@ public function remove($socket) } -/** - * Emits to all clients. - * - * @return {Namespace} self - * @api public - */ + /** + * Emits to all clients. + * + * @return {Namespace} self + * @api public + */ public function emit($ev = null) { diff --git a/src/Parser/Decoder.php b/src/Parser/Decoder.php index 59a660e..af8d324 100644 --- a/src/Parser/Decoder.php +++ b/src/Parser/Decoder.php @@ -5,15 +5,15 @@ use \PHPSocketIO\Debug; class Decoder extends Emitter { -public function __construct() -{ - Debug::debug('Decoder __construct'); -} + public function __construct() + { + Debug::debug('Decoder __construct'); + } -public function __destruct() -{ - Debug::debug('Decoder __destruct'); -} + public function __destruct() + { + Debug::debug('Decoder __destruct'); + } public function add($obj) { diff --git a/src/Parser/Encoder.php b/src/Parser/Encoder.php index 6410554..87a57fe 100644 --- a/src/Parser/Encoder.php +++ b/src/Parser/Encoder.php @@ -5,15 +5,15 @@ use \PHPSocketIO\Debug; class Encoder extends Emitter { -public function __construct() -{ - Debug::debug('Encoder __construct'); -} + public function __construct() + { + Debug::debug('Encoder __construct'); + } -public function __destruct() -{ - Debug::debug('Encoder __destruct'); -} + public function __destruct() + { + Debug::debug('Encoder __destruct'); + } public function encode($obj) diff --git a/src/Socket.php b/src/Socket.php index 61716a8..8daeba8 100644 --- a/src/Socket.php +++ b/src/Socket.php @@ -46,10 +46,10 @@ public function __construct($nsp, $client) Debug::debug('IO Socket __construct'); } -public function __destruct() -{ - Debug::debug('IO Socket __destruct'); -} + public function __destruct() + { + Debug::debug('IO Socket __destruct'); + } public function buildHandshake() { @@ -82,7 +82,7 @@ public function __get($name) return null; } - public function emit($ev) + public function emit($ev = null) { $args = func_get_args(); if (isset(self::$events[$ev]))