Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuxin committed Apr 9, 2019
1 parent a741fc3 commit 52442b7
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/Sandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function getHttp()
public function getApplication()
{
$snapshot = $this->getSnapshot();
if ($snapshot instanceOf Container) {
if ($snapshot instanceof Container) {
return $snapshot;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ public function __get($key)
{
return $this->get($key);
}
}
}
2 changes: 1 addition & 1 deletion src/Websocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/coroutine/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ public static function getCoroutineId()
{
return Coroutine::getuid();
}
}
}
2 changes: 1 addition & 1 deletion src/coroutine/PDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,4 @@ public function __destruct()
{
$this->client->close();
}
}
}
2 changes: 1 addition & 1 deletion src/coroutine/PDOStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,4 @@ public function fetchAll($fetchStyle = null, $fetchArgument = null, $ctorArgs =

return $resultSet;
}
}
}
2 changes: 1 addition & 1 deletion src/coroutine/connector/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ protected function isBreak($e): bool

return parent::isBreak($e) || Str::contains($e->getMessage(), 'is closed');
}
}
}
2 changes: 1 addition & 1 deletion src/facade/Room.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeClass()
{
return 'swoole.room';
}
}
}
2 changes: 1 addition & 1 deletion src/facade/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ protected static function getFacadeClass()
{
return 'swoole.server';
}
}
}
3 changes: 1 addition & 2 deletions src/facade/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace think\swoole\facade;


use think\Facade;

/**
Expand All @@ -25,4 +24,4 @@ protected static function getFacadeClass()
{
return 'swoole.table';
}
}
}
2 changes: 1 addition & 1 deletion src/facade/Websocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ protected static function getFacadeClass()
{
return 'swoole.websocket';
}
}
}
2 changes: 1 addition & 1 deletion src/resetters/ResetterContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ interface ResetterContract
* @param Sandbox $sandbox
*/
public function handle(Container $app, Sandbox $sandbox);
}
}
3 changes: 1 addition & 2 deletions src/websocket/HandlerContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace think\swoole\websocket;


use Swoole\Websocket\Frame;
use think\Request;

Expand Down Expand Up @@ -40,4 +39,4 @@ public function onMessage(Frame $frame);
* @param int $reactorId
*/
public function onClose($fd, $reactorId);
}
}
2 changes: 1 addition & 1 deletion src/websocket/Pusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,4 @@ public function push($payload): void
}
}
}
}
}
8 changes: 4 additions & 4 deletions src/websocket/socketio/Packet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 [
Expand All @@ -168,4 +168,4 @@ public static function isSocketType($packet, string $typeName)

return static::getSocketType($packet) === $type;
}
}
}
2 changes: 1 addition & 1 deletion src/websocket/socketio/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public function decode($frame)
'data' => $payload['data'] ?? null,
];
}
}
}

0 comments on commit 52442b7

Please sign in to comment.