From 24029ddf32f1a52105ffecafe35fdd0678f1151e Mon Sep 17 00:00:00 2001 From: Marc Reichel Date: Sat, 20 Dec 2025 19:51:18 +0100 Subject: [PATCH 1/5] chore: Add missing methods to ConnectionInterface --- src/Connection.php | 7 +++++++ src/ConnectionInterface.php | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/Connection.php b/src/Connection.php index 5a53b5a2..df9a52d1 100755 --- a/src/Connection.php +++ b/src/Connection.php @@ -750,6 +750,7 @@ public function transactionRollback(): void $this->rollBack(); } + #[\Override] public function hasOpenTransactions(): bool { return $this->numberOfOpenTransactions > 0; @@ -810,6 +811,7 @@ public function getTables(?string $prefix = null): array * @throws ConnectionException * @deprecated */ + #[\Override] public function getColumnsOfTable(string $tableName): array { if (!$this->hasTable($tableName)) { @@ -1263,6 +1265,7 @@ private function dbsafeParams(array $params, array | false $escapes = []): array * @return int|float|null|string * @deprecated we need to get rid of this */ + #[\Override] public function dbsafeString(mixed $input, bool $htmlSpecialChars = true, bool $addSlashes = true): mixed { // skip for numeric values to avoid php type juggling/autoboxing @@ -1298,6 +1301,7 @@ public function dbsafeString(mixed $input, bool $htmlSpecialChars = true, bool $ /** * Method to flush the query-cache. */ + #[\Override] public function flushQueryCache(): void { $this->queryCache = []; @@ -1308,6 +1312,7 @@ public function flushQueryCache(): void * Since the tables won't change during regular operations, * flushing the tables cache is only required during package updates / installations. */ + #[\Override] public function flushTablesCache(): void { $this->tablesCache = []; @@ -1319,6 +1324,7 @@ public function flushTablesCache(): void * * @throws ConnectionException */ + #[\Override] public function flushPreparedStatementsCache(): void { if (!$this->connected) { @@ -1375,6 +1381,7 @@ public function isConnected(): bool * method unifies the behaviour. In order to select a column, which contains a backslash you need to escape the value * with this method. */ + #[\Override] public function escape(mixed $value): mixed { return $this->dbDriver->escape($value); diff --git a/src/ConnectionInterface.php b/src/ConnectionInterface.php index ae8ed8e2..9ffc8021 100755 --- a/src/ConnectionInterface.php +++ b/src/ConnectionInterface.php @@ -377,4 +377,21 @@ public function getJsonColumnExpression(string $column, string $key): string; * @return string The generated SQL snippet. */ public function getNthLastElementFromSlug(string $column, int $position): string; + + public function flushQueryCache(): void; + + public function flushTablesCache(): void; + + public function flushPreparedStatementsCache(): void; + + /** + * @return array + */ + public function getColumnsOfTable(string $tableName): array; + + public function escape(mixed $value): mixed; + + public function dbsafeString(mixed $input, bool $htmlSpecialChars = true, bool $addSlashes = true): mixed; + + public function hasOpenTransactions(): bool; } From 18cf33f4fab6253111d352bf10db61d602d64adb Mon Sep 17 00:00:00 2001 From: Marc Reichel Date: Sat, 20 Dec 2025 19:54:13 +0100 Subject: [PATCH 2/5] chore: Add missing methods to ConnectionInterface --- src/MockConnection.php | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/MockConnection.php b/src/MockConnection.php index 12adb616..60fec6c2 100644 --- a/src/MockConnection.php +++ b/src/MockConnection.php @@ -419,4 +419,43 @@ public function getNthLastElementFromSlug(string $column, int $position): string { return ''; } + + #[\Override] + public function flushQueryCache(): void + { + } + + #[\Override] + public function flushTablesCache(): void + { + } + + #[\Override] + public function flushPreparedStatementsCache(): void + { + } + + #[\Override] + public function getColumnsOfTable(string $tableName): array + { + return []; + } + + #[\Override] + public function escape(mixed $value): mixed + { + return $value; + } + + #[\Override] + public function dbsafeString(mixed $input, bool $htmlSpecialChars = true, bool $addSlashes = true): mixed + { + return $input; + } + + #[\Override] + public function hasOpenTransactions(): bool + { + return false; + } } From 0eaacfc91bf3a919da807c4cfce01c13c03c38b3 Mon Sep 17 00:00:00 2001 From: Marc Reichel Date: Sat, 20 Dec 2025 20:04:01 +0100 Subject: [PATCH 3/5] chore: Add missing methods to ConnectionInterface --- src/MockConnection.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/MockConnection.php b/src/MockConnection.php index 60fec6c2..50f173c8 100644 --- a/src/MockConnection.php +++ b/src/MockConnection.php @@ -420,40 +420,40 @@ public function getNthLastElementFromSlug(string $column, int $position): string return ''; } - #[\Override] + #[Override] public function flushQueryCache(): void { } - #[\Override] + #[Override] public function flushTablesCache(): void { } - #[\Override] + #[Override] public function flushPreparedStatementsCache(): void { } - #[\Override] + #[Override] public function getColumnsOfTable(string $tableName): array { return []; } - #[\Override] + #[Override] public function escape(mixed $value): mixed { return $value; } - #[\Override] + #[Override] public function dbsafeString(mixed $input, bool $htmlSpecialChars = true, bool $addSlashes = true): mixed { return $input; } - #[\Override] + #[Override] public function hasOpenTransactions(): bool { return false; From 04473bc6980ab1a1642230285ee251a939230875 Mon Sep 17 00:00:00 2001 From: Marc Reichel Date: Mon, 22 Dec 2025 10:11:42 +0100 Subject: [PATCH 4/5] chore: Remove dbsafeString from interface --- src/ConnectionInterface.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ConnectionInterface.php b/src/ConnectionInterface.php index 9ffc8021..44c5ef92 100755 --- a/src/ConnectionInterface.php +++ b/src/ConnectionInterface.php @@ -391,7 +391,5 @@ public function getColumnsOfTable(string $tableName): array; public function escape(mixed $value): mixed; - public function dbsafeString(mixed $input, bool $htmlSpecialChars = true, bool $addSlashes = true): mixed; - public function hasOpenTransactions(): bool; } From 81696456f8644e7fe93b6af10acd58ea4dd42233 Mon Sep 17 00:00:00 2001 From: Marc Reichel Date: Mon, 22 Dec 2025 10:13:29 +0100 Subject: [PATCH 5/5] chore: Remove dbsafeString from interface --- src/Connection.php | 1 - src/MockConnection.php | 6 ------ 2 files changed, 7 deletions(-) diff --git a/src/Connection.php b/src/Connection.php index df9a52d1..e6db4a19 100755 --- a/src/Connection.php +++ b/src/Connection.php @@ -1265,7 +1265,6 @@ private function dbsafeParams(array $params, array | false $escapes = []): array * @return int|float|null|string * @deprecated we need to get rid of this */ - #[\Override] public function dbsafeString(mixed $input, bool $htmlSpecialChars = true, bool $addSlashes = true): mixed { // skip for numeric values to avoid php type juggling/autoboxing diff --git a/src/MockConnection.php b/src/MockConnection.php index 50f173c8..95015445 100644 --- a/src/MockConnection.php +++ b/src/MockConnection.php @@ -447,12 +447,6 @@ public function escape(mixed $value): mixed return $value; } - #[Override] - public function dbsafeString(mixed $input, bool $htmlSpecialChars = true, bool $addSlashes = true): mixed - { - return $input; - } - #[Override] public function hasOpenTransactions(): bool {