From 2b902f3624da0c4e32aa544039361c936e9fd0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 29 Aug 2023 22:21:42 +0800 Subject: [PATCH] eee --- Connection.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Connection.php b/Connection.php index 6c14467..6d28b32 100644 --- a/Connection.php +++ b/Connection.php @@ -377,11 +377,11 @@ class Connection extends Component /** - * @return array + * @return PDO */ - public function newConnect(): array + public function newConnect(): PDO { - return [new PDO('mysql:dbname=' . $this->database . ';host=' . $this->cds, + return new PDO('mysql:dbname=' . $this->database . ';host=' . $this->cds, $this->username, $this->password, array_merge($this->attributes, [ PDO::ATTR_CASE => PDO::CASE_NATURAL, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, @@ -390,7 +390,7 @@ class Connection extends Component PDO::ATTR_EMULATE_PREPARES => true, PDO::ATTR_TIMEOUT => $this->connect_timeout, PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES ' . $this->charset - ])), time()]; + ])); }