!9 修复 PHP8.4 报错问题。

Merge pull request !9 from DingYi/master
This commit is contained in:
Karson
2025-06-17 02:33:00 +00:00
committed by Gitee
5 changed files with 7 additions and 7 deletions

View File

@@ -406,7 +406,7 @@ abstract class Connection
* @throws PDOException
* @throws \Exception
*/
public function execute($sql, $bind = [], Query $query = null)
public function execute($sql, $bind = [], ?Query $query = null)
{
$this->initConnect(true);
if (!$this->linkID) {
@@ -738,7 +738,7 @@ abstract class Connection
* @param array $sqlArray SQL批处理指令
* @return boolean
*/
public function batchQuery($sqlArray = [], $bind = [], Query $query = null)
public function batchQuery($sqlArray = [], $bind = [], ?Query $query = null)
{
if (!is_array($sqlArray)) {
return false;

View File

@@ -62,7 +62,7 @@ class Query
* @param Connection $connection 数据库对象实例
* @param Model $model 模型对象
*/
public function __construct(Connection $connection = null, $model = null)
public function __construct(?Connection $connection = null, $model = null)
{
$this->connection = $connection ?: Db::connect([], true);
$this->prefix = $this->connection->getConfig('prefix');