aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Pdo.php4
-rw-r--r--lib/Minz/PdoMysql.php2
-rw-r--r--lib/Minz/PdoPgsql.php2
-rw-r--r--lib/Minz/PdoSqlite.php2
4 files changed, 10 insertions, 0 deletions
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);
diff --git a/lib/Minz/PdoMysql.php b/lib/Minz/PdoMysql.php
index a6d927308..3f7a804a3 100644
--- a/lib/Minz/PdoMysql.php
+++ b/lib/Minz/PdoMysql.php
@@ -16,6 +16,7 @@ class Minz_PdoMysql extends Minz_Pdo {
$this->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
}
+ #[\Override]
public function dbType(): string {
return 'mysql';
}
@@ -25,6 +26,7 @@ class Minz_PdoMysql extends Minz_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) {
return parent::lastInsertId(); //We discard the name, only used by PostgreSQL
diff --git a/lib/Minz/PdoPgsql.php b/lib/Minz/PdoPgsql.php
index f60dd695f..d075c396f 100644
--- a/lib/Minz/PdoPgsql.php
+++ b/lib/Minz/PdoPgsql.php
@@ -16,10 +16,12 @@ class Minz_PdoPgsql extends Minz_Pdo {
$this->exec("SET NAMES 'UTF8';");
}
+ #[\Override]
public function dbType(): string {
return 'pgsql';
}
+ #[\Override]
protected function preSql(string $statement): string {
$statement = parent::preSql($statement);
return str_replace(array('`', ' LIKE '), array('"', ' ILIKE '), $statement);
diff --git a/lib/Minz/PdoSqlite.php b/lib/Minz/PdoSqlite.php
index cecc68a64..537b6cdc6 100644
--- a/lib/Minz/PdoSqlite.php
+++ b/lib/Minz/PdoSqlite.php
@@ -16,6 +16,7 @@ class Minz_PdoSqlite extends Minz_Pdo {
$this->exec('PRAGMA foreign_keys = ON;');
}
+ #[\Override]
public function dbType(): string {
return 'sqlite';
}
@@ -25,6 +26,7 @@ class Minz_PdoSqlite extends Minz_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) {
return parent::lastInsertId(); //We discard the name, only used by PostgreSQL