Skip to content

Commit

Permalink
maintenance: qa tests
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Oct 11, 2023
1 parent cda6c45 commit a1b7211
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Query/SqlQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use PDOStatement;
use Gt\Database\Result\ResultSet;

/** @SuppressWarnings(PHPMD.ExcessiveClassComplexity) */
class SqlQuery extends Query {
const SPECIAL_BINDINGS = [
"limit",
Expand Down Expand Up @@ -194,6 +195,7 @@ private function injectDynamicIn(string $sql, array &$data):string {
return str_replace($matches[0], "( $replacementString )", $sql);
}

/** @param array<string, array<string, string>> &$data */
private function injectDynamicOr(string $sql, array &$data):string {
$pattern = '/:__dynamicOr/';
if(!preg_match($pattern, $sql, $matches)) {
Expand All @@ -204,7 +206,8 @@ private function injectDynamicOr(string $sql, array &$data):string {
}

$replacementString = "";
foreach($data["__dynamicOr"] as $i => $kvp) {
/** @var array<string, string> $kvp */
foreach($data["__dynamicOr"] as $kvp) {
$conditionString = "";
foreach($kvp as $key => $value) {
if(is_string($value)) {
Expand Down

0 comments on commit a1b7211

Please sign in to comment.