diff options
| author | 2023-05-11 13:02:04 +0200 | |
|---|---|---|
| committer | 2023-05-11 13:02:04 +0200 | |
| commit | 6e2f2f1c1e98ecd86aa89c6547beb742d7385d18 (patch) | |
| tree | 7ba9f5aebb01d12045b9067a86b5060ba13dca18 /lib/Minz/Pdo.php | |
| parent | fe7d9bbcd68660a59b813346c236b61b25a51c80 (diff) | |
A few additional PHPStan rules (#5388)
A subset of
https://github.com/phpstan/phpstan-strict-rules
Diffstat (limited to 'lib/Minz/Pdo.php')
| -rw-r--r-- | lib/Minz/Pdo.php | 13 |
1 files changed, 7 insertions, 6 deletions
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<int,string>|null $driver_options + * @param string $query + * @param array<int,string>|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); } } |
