From 6e2f2f1c1e98ecd86aa89c6547beb742d7385d18 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 11 May 2023 13:02:04 +0200 Subject: A few additional PHPStan rules (#5388) A subset of https://github.com/phpstan/phpstan-strict-rules --- lib/Minz/Pdo.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/Minz/Pdo.php') diff --git a/lib/Minz/Pdo.php b/lib/Minz/Pdo.php index 41a3e9c84..14acd484d 100644 --- a/lib/Minz/Pdo.php +++ b/lib/Minz/Pdo.php @@ -49,14 +49,15 @@ abstract class Minz_Pdo extends PDO { // PHP8+: PDO::prepare(string $query, array $options = []): PDOStatement|false /** - * @param string $statement - * @param array|null $driver_options + * @param string $query + * @param array|null $options * @return PDOStatement|false + * @phpstan-ignore-next-line */ #[\ReturnTypeWillChange] - public function prepare($statement, $driver_options = []) { - $statement = $this->preSql($statement); - return parent::prepare($statement, $driver_options); + public function prepare($query, $options = []) { + $query = $this->preSql($query); + return parent::prepare($query, $options); } // PHP8+: PDO::exec(string $statement): int|false @@ -74,6 +75,6 @@ abstract class Minz_Pdo extends PDO { #[\ReturnTypeWillChange] public function query(string $query, ?int $fetch_mode = null, ...$fetch_mode_args) { $query = $this->preSql($query); - return $fetch_mode ? parent::query($query, $fetch_mode, ...$fetch_mode_args) : parent::query($query); + return $fetch_mode === null ? parent::query($query) : parent::query($query, $fetch_mode, ...$fetch_mode_args); } } -- cgit v1.2.3