diff --git a/composer.json b/composer.json index f3bff77..aef47e4 100644 --- a/composer.json +++ b/composer.json @@ -41,6 +41,11 @@ }, "config": { "preferred-install": "dist", - "sort-packages": true + "sort-packages": true, + "platform-check": false, + "platform": { + "ext-swoole": "4.4.8", + "ext-fileinfo": "1.0.4" + } } } diff --git a/src/Table.php b/src/Table.php index b2327c7..bd08a02 100644 --- a/src/Table.php +++ b/src/Table.php @@ -15,6 +15,12 @@ class Table { + public const TYPE_INT = 1; + + public const TYPE_STRING = 3; + + public const TYPE_FLOAT = 2; + /** * Registered swoole tables. * @@ -25,7 +31,7 @@ class Table /** * Add a swoole table to existing tables. * - * @param string $name + * @param string $name * @param SwooleTable $table * * @return Table @@ -62,11 +68,11 @@ public function getAll() /** * Dynamically access table. * - * @param string $key + * @param string $key * * @return SwooleTable */ - public function __get($key) + public function __get(string $key) { return $this->get($key); } diff --git a/src/concerns/InteractsWithSwooleTable.php b/src/concerns/InteractsWithSwooleTable.php index 6fd4a19..69657cf 100644 --- a/src/concerns/InteractsWithSwooleTable.php +++ b/src/concerns/InteractsWithSwooleTable.php @@ -20,7 +20,7 @@ * Trait InteractsWithSwooleTable * * @property Container $container - * @property App $app + * @property App $app */ trait InteractsWithSwooleTable { diff --git a/src/concerns/InteractsWithWebsocket.php b/src/concerns/InteractsWithWebsocket.php index 396fd9e..d05969c 100644 --- a/src/concerns/InteractsWithWebsocket.php +++ b/src/concerns/InteractsWithWebsocket.php @@ -63,6 +63,7 @@ public function onOpen($server, $req) $this->runInSandbox(function (Event $event, HandlerInterface $handler, App $app) use ($req) { $request = $this->prepareRequest($req); + $app->instance('request', $request); $request = $this->setRequestThroughMiddleware($app, $request); if (!$handler->onOpen($req->fd, $request)) {