mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 16:45:35 +08:00
strict to phpstan-level-4
This commit is contained in:
@@ -9,8 +9,6 @@ declare(strict_types=1);
|
||||
namespace ZM\DB;
|
||||
|
||||
use PDOException;
|
||||
use PDOStatement;
|
||||
use Swoole\Database\PDOStatementProxy;
|
||||
use ZM\Console\Console;
|
||||
use ZM\Exception\DbException;
|
||||
use ZM\MySQL\MySQLManager;
|
||||
@@ -102,11 +100,6 @@ class DB
|
||||
SqlPoolStorage::$sql_pool->putConnection(null);
|
||||
throw new DbException('SQL语句查询错误,' . $line . ',错误信息:' . $conn->errorInfo()[2]);
|
||||
}
|
||||
if (!($ps instanceof PDOStatement) && !($ps instanceof PDOStatementProxy)) {
|
||||
var_dump($ps);
|
||||
SqlPoolStorage::$sql_pool->putConnection(null);
|
||||
throw new DbException('语句查询错误!返回的不是 PDOStatement' . $line);
|
||||
}
|
||||
if ($params == []) {
|
||||
$result = $ps->execute();
|
||||
} elseif (!is_array($params)) {
|
||||
|
||||
@@ -47,7 +47,7 @@ class SelectBody
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $fetch_mode
|
||||
* @param mixed $fetch_mode
|
||||
* @throws DbException
|
||||
*/
|
||||
public function fetchAll($fetch_mode = ZM_DEFAULT_FETCH_MODE)
|
||||
@@ -66,7 +66,7 @@ class SelectBody
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $key
|
||||
* @param null|mixed $key
|
||||
* @throws DbException
|
||||
* @return null|mixed
|
||||
*/
|
||||
@@ -83,10 +83,9 @@ class SelectBody
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $fetch_mode
|
||||
* @throws DbException
|
||||
*/
|
||||
public function execute($fetch_mode = ZM_DEFAULT_FETCH_MODE)
|
||||
public function execute(int $fetch_mode = ZM_DEFAULT_FETCH_MODE)
|
||||
{
|
||||
$str = $this->queryPrepare();
|
||||
$this->result = DB::rawQuery($str[0], $str[1], $fetch_mode);
|
||||
|
||||
Reference in New Issue
Block a user