From 350edf398c55b472e19a3017de9b4d2d3420b9e4 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 10 Apr 2024 15:33:43 +0200 Subject: PHP 8.3 #[\Override] (#6273) * PHP 8.3 #[\Override] https://php.watch/versions/8.3/override-attr With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute And modified the call to phpstan-next on the model of https://github.com/FreshRSS/Extensions/pull/228 (more robust than the find method, which gave some strange errors) * Update extension example accordingly --- lib/Minz/Pdo.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Minz/Pdo.php') diff --git a/lib/Minz/Pdo.php b/lib/Minz/Pdo.php index 2f053c2af..bb07de488 100644 --- a/lib/Minz/Pdo.php +++ b/lib/Minz/Pdo.php @@ -43,6 +43,7 @@ abstract class Minz_Pdo extends PDO { * @return string|false * @throws PDOException if the attribute `PDO::ATTR_ERRMODE` is set to `PDO::ERRMODE_EXCEPTION` */ + #[\Override] #[\ReturnTypeWillChange] public function lastInsertId($name = null) { if ($name != null) { @@ -59,6 +60,7 @@ abstract class Minz_Pdo extends PDO { * @throws PDOException if the attribute `PDO::ATTR_ERRMODE` is set to `PDO::ERRMODE_EXCEPTION` * @phpstan-ignore-next-line */ + #[\Override] #[\ReturnTypeWillChange] public function prepare($query, $options = []) { $query = $this->preSql($query); @@ -72,6 +74,7 @@ abstract class Minz_Pdo extends PDO { * @throws PDOException if the attribute `PDO::ATTR_ERRMODE` is set to `PDO::ERRMODE_EXCEPTION` * @phpstan-ignore-next-line */ + #[\Override] #[\ReturnTypeWillChange] public function exec($statement) { $statement = $this->preSql($statement); @@ -83,6 +86,7 @@ abstract class Minz_Pdo extends PDO { * @throws PDOException if the attribute `PDO::ATTR_ERRMODE` is set to `PDO::ERRMODE_EXCEPTION` * @phpstan-ignore-next-line */ + #[\Override] #[\ReturnTypeWillChange] public function query(string $query, ?int $fetch_mode = null, ...$fetch_mode_args) { $query = $this->preSql($query); -- cgit v1.2.3