From a1b721159dbe7d409d5f2a1c91bcc7ada5dcd08d Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Wed, 11 Oct 2023 13:32:55 +0100 Subject: [PATCH] maintenance: qa tests --- src/Query/SqlQuery.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Query/SqlQuery.php b/src/Query/SqlQuery.php index 6bcf6c8..88c20fd 100644 --- a/src/Query/SqlQuery.php +++ b/src/Query/SqlQuery.php @@ -7,6 +7,7 @@ use PDOStatement; use Gt\Database\Result\ResultSet; +/** @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */ class SqlQuery extends Query { const SPECIAL_BINDINGS = [ "limit", @@ -194,6 +195,7 @@ private function injectDynamicIn(string $sql, array &$data):string { return str_replace($matches[0], "( $replacementString )", $sql); } + /** @param array> &$data */ private function injectDynamicOr(string $sql, array &$data):string { $pattern = '/:__dynamicOr/'; if(!preg_match($pattern, $sql, $matches)) { @@ -204,7 +206,8 @@ private function injectDynamicOr(string $sql, array &$data):string { } $replacementString = ""; - foreach($data["__dynamicOr"] as $i => $kvp) { + /** @var array $kvp */ + foreach($data["__dynamicOr"] as $kvp) { $conditionString = ""; foreach($kvp as $key => $value) { if(is_string($value)) {