diff --git a/Command.php b/Command.php index 3644b43..3a19da5 100644 --- a/Command.php +++ b/Command.php @@ -208,7 +208,7 @@ class Command extends Component } /** - * @return array|bool + * @return array|bool * @throws Exception */ private function search(): bool|array diff --git a/Connection.php b/Connection.php index 8e6eac4..24a80e0 100644 --- a/Connection.php +++ b/Connection.php @@ -160,7 +160,7 @@ class Connection extends Component } /** - * @return PDO + * @return Mysql\PDO * @throws Exception */ public function getSlaveClient(): Mysql\PDO diff --git a/Mysql/PDO.php b/Mysql/PDO.php index a2ef906..6b6d727 100644 --- a/Mysql/PDO.php +++ b/Mysql/PDO.php @@ -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); + } + + /** * */