变更
This commit is contained in:
+1
-1
@@ -208,7 +208,7 @@ class Command extends Component
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<PDO, PDOStatement>|bool
|
||||
* @return array<Mysql\PDO, PDOStatement>|bool
|
||||
* @throws Exception
|
||||
*/
|
||||
private function search(): bool|array
|
||||
|
||||
+1
-1
@@ -160,7 +160,7 @@ class Connection extends Component
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PDO
|
||||
* @return Mysql\PDO
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getSlaveClient(): Mysql\PDO
|
||||
|
||||
+22
-1
@@ -13,7 +13,7 @@ use Kiri\Server\Abstracts\StatusEnum;
|
||||
use Swoole\Timer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @mixin \PDO
|
||||
*/
|
||||
class PDO implements StopHeartbeatCheck
|
||||
{
|
||||
@@ -89,6 +89,27 @@ class PDO implements StopHeartbeatCheck
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param array $arguments
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call(string $name, array $arguments)
|
||||
{
|
||||
return $this->_pdo()->{$name}(...$arguments);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $sql
|
||||
* @return PDOStatement|bool
|
||||
*/
|
||||
public function prepare(string $sql): PDOStatement|bool
|
||||
{
|
||||
return $this->_pdo()->prepare($sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user