Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix types of ExtendedQueryBuilder
Signed-off-by: Carl Schwan <[email protected]>
  • Loading branch information
CarlSchwan committed Jun 20, 2022
commit e93bba0e3658cd1befe584a23f3d8b62a9c1edfb
30 changes: 15 additions & 15 deletions lib/Tools/Db/ExtendedQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function exprFieldWithinJsonFormat(
$func->concat($fieldRight, $qb->createNamedParameter('"%'))
);

return $expr->iLike($alias . '.' . $field, $concat);
return (string)$expr->iLike($alias . '.' . $field, $concat);
}


Expand Down Expand Up @@ -303,7 +303,7 @@ public function exprValueWithinJsonFormat(
$comp = 'notLike';
}

return $expr->$comp($field, $qb->createNamedParameter('%"' . $value . '"%'));
return (string)$expr->$comp($field, $qb->createNamedParameter('%"' . $value . '"%'));
}


Expand Down Expand Up @@ -428,9 +428,9 @@ public function exprLike(string $field, string $value, string $alias = '', bool

$expr = $this->expr();
if ($cs) {
return $expr->like($field, $this->createNamedParameter($value));
return (string)$expr->like($field, $this->createNamedParameter($value));
} else {
return $expr->iLike($field, $this->createNamedParameter($value));
return (string)$expr->iLike($field, $this->createNamedParameter($value));
}
}

Expand All @@ -450,11 +450,11 @@ public function exprLimit(string $field, string $value, string $alias = '', bool

$expr = $this->expr();
if ($cs) {
return $expr->eq($field, $this->createNamedParameter($value));
return (string)$expr->eq($field, $this->createNamedParameter($value));
} else {
$func = $this->func();

return $expr->eq($func->lower($field), $func->lower($this->createNamedParameter($value)));
return (string)$expr->eq($func->lower($field), $func->lower($this->createNamedParameter($value)));
}
}

Expand All @@ -473,7 +473,7 @@ public function exprLimitInt(string $field, int $value, string $alias = ''): str

$expr = $this->expr();

return $expr->eq($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
return (string)$expr->eq($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
}


Expand Down Expand Up @@ -592,7 +592,7 @@ public function exprLimitInArray(string $field, array $values, string $alias = '

$expr = $this->expr();

return $expr->in($field, $this->createNamedParameter($values, IQueryBuilder::PARAM_STR_ARRAY));
return (string)$expr->in($field, $this->createNamedParameter($values, IQueryBuilder::PARAM_STR_ARRAY));
}


Expand All @@ -610,7 +610,7 @@ public function exprLimitBitwise(string $field, int $flag, string $alias = ''):

$expr = $this->expr();

return $expr->gt(
return (string)$expr->gt(
$expr->bitwiseAnd($field, $flag),
$this->createNamedParameter(0, IQueryBuilder::PARAM_INT)
);
Expand All @@ -633,9 +633,9 @@ public function exprLt(string $field, int $value, bool $lte = false, string $ali
$expr = $this->expr();

if ($lte) {
return $expr->lte($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
return (string)$expr->lte($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
} else {
return $expr->lt($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
return (string)$expr->lt($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
}
}

Expand All @@ -655,9 +655,9 @@ public function exprGt(string $field, int $value, bool $gte = false, string $ali
$expr = $this->expr();

if ($gte) {
return $expr->gte($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
return (string)$expr->gte($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
} else {
return $expr->gt($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
return (string)$expr->gt($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT));
}
}

Expand Down Expand Up @@ -763,11 +763,11 @@ public function exprUnlike(string $field, string $value, string $alias = '', boo

$expr = $this->expr();
if ($cs) {
return $expr->notLike($field, $this->createNamedParameter($value));
return (string)$expr->notLike($field, $this->createNamedParameter($value));
} else {
$func = $this->func();

return $expr->notLike($func->lower($field), $func->lower($this->createNamedParameter($value)));
return (string)$expr->notLike($func->lower($field), $func->lower($this->createNamedParameter($value)));
}
}

Expand Down