gpt4 book ai didi

php - OM\Db::query(string $statement) 的声明必须与 PDO::query 兼容

转载 作者:行者123 更新时间:2023-12-04 14:44:35 25 4
gpt4 key购买 nike

我刚刚安装了 PHP 8 并且出现了这个错误?我如何解决它?

Fatal error: Declaration of OM\Db::query(string $statement) must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs) in /home/www/includes/OM/Db.php on line 131


我的 OM/Db.php
public function query(string $statement) =====> line 131
{
$statement = $this->autoPrefixTables($statement);

$args = func_get_args();

if (count($args) > 1) {
$DbStatement = call_user_func_array(array($this, 'parent::query'), $args);
} else {
$DbStatement = parent::query($statement);
}

if ($DbStatement !== false) {
$DbStatement->setQueryCall('query');
$DbStatement->setPDO($this);
}

return $DbStatement;
}

最佳答案

#1 - 从 Composer Json 中删除类似的行

"doctrine/dbal": "^2.10",


#2 - 跑

composer upgrade


#3 - 跑

composer update


#4 - 瞧!错误应该被修复!

关于php - OM\Db::query(string $statement) 的声明必须与 PDO::query 兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64726900/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com