diff --git a/src/Sandbox.php b/src/Sandbox.php index 944d7ef..7b4fe64 100644 --- a/src/Sandbox.php +++ b/src/Sandbox.php @@ -129,7 +129,7 @@ protected function getHttp() public function getApplication() { $snapshot = $this->getSnapshot(); - if ($snapshot instanceOf Container) { + if ($snapshot instanceof Container) { return $snapshot; } diff --git a/src/Table.php b/src/Table.php index 3ce6bfa..b2327c7 100644 --- a/src/Table.php +++ b/src/Table.php @@ -70,4 +70,4 @@ public function __get($key) { return $this->get($key); } -} \ No newline at end of file +} diff --git a/src/Websocket.php b/src/Websocket.php index bc8cdb1..95bea5f 100644 --- a/src/Websocket.php +++ b/src/Websocket.php @@ -227,7 +227,7 @@ public function eventExists(string $event) public function call(string $event, $data = null) { if (!$this->eventExists($event)) { - return null; + return; } // inject request param on connect event diff --git a/src/coroutine/Context.php b/src/coroutine/Context.php index 6ad4b37..4b73978 100644 --- a/src/coroutine/Context.php +++ b/src/coroutine/Context.php @@ -96,4 +96,4 @@ public static function getCoroutineId() { return Coroutine::getuid(); } -} \ No newline at end of file +} diff --git a/src/coroutine/PDO.php b/src/coroutine/PDO.php index f7aadb9..e1bf879 100644 --- a/src/coroutine/PDO.php +++ b/src/coroutine/PDO.php @@ -312,4 +312,4 @@ public function __destruct() { $this->client->close(); } -} \ No newline at end of file +} diff --git a/src/coroutine/PDOStatement.php b/src/coroutine/PDOStatement.php index 2877af5..030622e 100644 --- a/src/coroutine/PDOStatement.php +++ b/src/coroutine/PDOStatement.php @@ -251,4 +251,4 @@ public function fetchAll($fetchStyle = null, $fetchArgument = null, $ctorArgs = return $resultSet; } -} \ No newline at end of file +} diff --git a/src/coroutine/connector/Mysql.php b/src/coroutine/connector/Mysql.php index e01ce6b..3d5dd3d 100644 --- a/src/coroutine/connector/Mysql.php +++ b/src/coroutine/connector/Mysql.php @@ -30,4 +30,4 @@ protected function isBreak($e): bool return parent::isBreak($e) || Str::contains($e->getMessage(), 'is closed'); } -} \ No newline at end of file +} diff --git a/src/facade/Room.php b/src/facade/Room.php index 1e89f85..b6d2c21 100644 --- a/src/facade/Room.php +++ b/src/facade/Room.php @@ -10,4 +10,4 @@ protected static function getFacadeClass() { return 'swoole.room'; } -} \ No newline at end of file +} diff --git a/src/facade/Server.php b/src/facade/Server.php index fbbfd9f..6f54a18 100644 --- a/src/facade/Server.php +++ b/src/facade/Server.php @@ -19,4 +19,4 @@ protected static function getFacadeClass() { return 'swoole.server'; } -} \ No newline at end of file +} diff --git a/src/facade/Table.php b/src/facade/Table.php index 0db7638..1f64781 100644 --- a/src/facade/Table.php +++ b/src/facade/Table.php @@ -11,7 +11,6 @@ namespace think\swoole\facade; - use think\Facade; /** @@ -25,4 +24,4 @@ protected static function getFacadeClass() { return 'swoole.table'; } -} \ No newline at end of file +} diff --git a/src/facade/Websocket.php b/src/facade/Websocket.php index 33fd75f..dd5bd7f 100644 --- a/src/facade/Websocket.php +++ b/src/facade/Websocket.php @@ -10,4 +10,4 @@ protected static function getFacadeClass() { return 'swoole.websocket'; } -} \ No newline at end of file +} diff --git a/src/resetters/ResetterContract.php b/src/resetters/ResetterContract.php index 9ba6261..c5087d6 100644 --- a/src/resetters/ResetterContract.php +++ b/src/resetters/ResetterContract.php @@ -14,4 +14,4 @@ interface ResetterContract * @param Sandbox $sandbox */ public function handle(Container $app, Sandbox $sandbox); -} \ No newline at end of file +} diff --git a/src/websocket/HandlerContract.php b/src/websocket/HandlerContract.php index 057cce8..f1804e5 100644 --- a/src/websocket/HandlerContract.php +++ b/src/websocket/HandlerContract.php @@ -11,7 +11,6 @@ namespace think\swoole\websocket; - use Swoole\Websocket\Frame; use think\Request; @@ -40,4 +39,4 @@ public function onMessage(Frame $frame); * @param int $reactorId */ public function onClose($fd, $reactorId); -} \ No newline at end of file +} diff --git a/src/websocket/Pusher.php b/src/websocket/Pusher.php index fba6117..21cf127 100644 --- a/src/websocket/Pusher.php +++ b/src/websocket/Pusher.php @@ -276,4 +276,4 @@ public function push($payload): void } } } -} \ No newline at end of file +} diff --git a/src/websocket/socketio/Packet.php b/src/websocket/socketio/Packet.php index 04d0bb0..b3812bb 100644 --- a/src/websocket/socketio/Packet.php +++ b/src/websocket/socketio/Packet.php @@ -115,7 +115,7 @@ public static function getSocketType(string $packet) $type = $packet[0] ?? null; if (!array_key_exists($type, static::$socketTypes)) { - return null; + return; } return (int) $type; @@ -134,14 +134,14 @@ public static function getPayload(string $packet) $start = strpos($packet, '['); if ($start === false || substr($packet, -1) !== ']') { - return null; + return; } $data = substr($packet, $start, strlen($packet) - $start); $data = json_decode($data, true); if (is_null($data)) { - return null; + return; } return [ @@ -168,4 +168,4 @@ public static function isSocketType($packet, string $typeName) return static::getSocketType($packet) === $type; } -} \ No newline at end of file +} diff --git a/src/websocket/socketio/Parser.php b/src/websocket/socketio/Parser.php index 9040c76..b8f7c12 100644 --- a/src/websocket/socketio/Parser.php +++ b/src/websocket/socketio/Parser.php @@ -48,4 +48,4 @@ public function decode($frame) 'data' => $payload['data'] ?? null, ]; } -} \ No newline at end of file +}