From f1ebb7f32c1d153ddce32692d13fd7ca7fa870d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 22 Feb 2021 10:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Abstracts/BaseApplication.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/System/Abstracts/BaseApplication.php b/System/Abstracts/BaseApplication.php index 6ebf6de8..40a2b757 100644 --- a/System/Abstracts/BaseApplication.php +++ b/System/Abstracts/BaseApplication.php @@ -21,6 +21,7 @@ use HttpServer\Service\Http; use HttpServer\Service\Packet; use HttpServer\Service\Receive; use HttpServer\Service\Websocket; +use JetBrains\PhpStorm\Pure; use Kafka\Producer; use Annotation\Annotation as SAnnotation; use Snowflake\Async; @@ -37,6 +38,7 @@ use Snowflake\Snowflake; use Snowflake\Event; use Snowflake\Pool\Pool as SPool; use Database\DatabasesProviders; +use Swoole\Table; /** * Class BaseApplication @@ -133,7 +135,7 @@ abstract class BaseApplication extends Service * * @return bool */ - protected function looksLikeSetter(string $line): bool + #[Pure] protected function looksLikeSetter(string $line): bool { return str_contains($line, '='); } @@ -311,6 +313,17 @@ abstract class BaseApplication extends Service } + /** + * @param $name + * @return Table + * @throws ComponentException + */ + public function getTable($name): Table + { + return $this->get($name); + } + + /** * @return Config * @throws ComponentException