From c4cf0511390ea7159a1fab751b510061624c46d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 28 Jun 2021 14:56:16 +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/Pool/Connection.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 773bff76..2edf4293 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -60,7 +60,7 @@ class Connection extends Pool Context::setContext('begin_' . $coroutineName, 0); } Context::increment('begin_' . $coroutineName); - if (!Context::getContext('begin_' . $coroutineName) !== 0) { + if (Context::getContext('begin_' . $coroutineName) != 0) { return; } $connection = Context::getContext($coroutineName); @@ -92,16 +92,6 @@ class Connection extends Pool } - /** - * @param $name - * @param false $isMaster - * @return array - */ - private function getIndex($name, $isMaster = false): array - { - return [Coroutine::getCid(), $this->name('mysql', $name, $isMaster)]; - } - /** * @param $coroutineName */ @@ -129,7 +119,7 @@ class Connection extends Pool * @return mixed * @throws Exception */ - public function get(mixed $config, $isMaster = false): mixed + public function get(mixed $config, bool $isMaster = false): mixed { $coroutineName = $this->name('mysql', $config['cds'], $isMaster); if (($pdo = Context::getContext($coroutineName)) instanceof PDO) {