From 4dc451fe7a3ff59797a6d6b96c22892b7f88c83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 11 Sep 2020 17:59:38 +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 --- Database/Connection.php | 5 +---- Database/Db.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Database/Connection.php b/Database/Connection.php index 8bcef614..fe2f3856 100644 --- a/Database/Connection.php +++ b/Database/Connection.php @@ -250,10 +250,7 @@ class Connection extends Component */ public function createCommand($sql = null, $attributes = []) { - $command = new Command([ - 'db' => $this - ]); - $command->setSql($sql); + $command = new Command(['db' => $this, 'sql' => $sql]); return $command->bindValues($attributes); } diff --git a/Database/Db.php b/Database/Db.php index 7dbd85c8..ade01761 100644 --- a/Database/Db.php +++ b/Database/Db.php @@ -112,7 +112,7 @@ class Db } /** - * @param Connection $db + * @param Connection|null $db * @return array|mixed * @throws Exception */