aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/TaskProcessing/Db
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-07-04 11:26:17 +0200
committerJoas Schilling <coding@schilljs.com>2024-07-19 11:21:16 +0200
commiteeb6ddb176adc7488b74d004dceafee960603ebc (patch)
tree50c3bf5d7d1df99c9ea661f68eaded03b6dac3f4 /lib/private/TaskProcessing/Db
parente45465781f1d9d6d64501dee46c8f4b4704e5918 (diff)
downloadnextcloud-server-eeb6ddb176adc7488b74d004dceafee960603ebc.tar.gz
nextcloud-server-eeb6ddb176adc7488b74d004dceafee960603ebc.zip
fix(db): Deprecate `IExpressionBuilder::or()` and `IExpressionBuilder::and()` without parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/TaskProcessing/Db')
-rw-r--r--lib/private/TaskProcessing/Db/TaskMapper.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/private/TaskProcessing/Db/TaskMapper.php b/lib/private/TaskProcessing/Db/TaskMapper.php
index 86b2a2fcc59..da3910dcb3d 100644
--- a/lib/private/TaskProcessing/Db/TaskMapper.php
+++ b/lib/private/TaskProcessing/Db/TaskMapper.php
@@ -59,16 +59,16 @@ class TaskMapper extends QBMapper {
->setMaxResults(1)
->orderBy('last_updated', 'ASC');
- if (count($taskTypes) > 0) {
- $filter = $qb->expr()->orX();
+ if (!empty($taskTypes)) {
+ $filter = [];
foreach ($taskTypes as $taskType) {
- $filter->add($qb->expr()->eq('type', $qb->createPositionalParameter($taskType)));
+ $filter[] = $qb->expr()->eq('type', $qb->createPositionalParameter($taskType));
}
- $qb->andWhere($filter);
+ $qb->andWhere($qb->expr()->orX(...$filter));
}
- if (count($taskIdsToIgnore) > 0) {
+ if (!empty($taskIdsToIgnore)) {
$qb->andWhere($qb->expr()->notIn('id', $qb->createNamedParameter($taskIdsToIgnore, IQueryBuilder::PARAM_INT_ARRAY)));
}