Skip to content

Commit

Permalink
[BUGFIX] Remove redundant call to array_values() (#1388)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer authored Dec 16, 2024
1 parent 5161a46 commit 9b73c2c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Classes/Domain/Repository/CollectionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function findAllByUids(array $uids): QueryResultInterface
$constraints[] = $query->in('uid', $uids);

if (count($constraints)) {
$query->matching($query->logicalAnd(...array_values($constraints)));
$query->matching($query->logicalAnd(...$constraints));
}

return $query->execute();
Expand Down Expand Up @@ -117,7 +117,7 @@ public function findCollectionsBySettings(array $settings = []): QueryResultInte

if (count($constraints)) {
$query->matching(
$query->logicalAnd(...array_values($constraints))
$query->logicalAnd(...$constraints)
);
}

Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Repository/DocumentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function findDocumentsBySettings($settings = [])

if (count($constraints)) {
$query->matching(
$query->logicalAnd(...array_values($constraints))
$query->logicalAnd(...$constraints)
);
}

Expand Down Expand Up @@ -216,7 +216,7 @@ public function findAllByCollectionsLimited($collections, int $limit = 50, int $

if (count($constraints)) {
$query->matching(
$query->logicalAnd(...array_values($constraints))
$query->logicalAnd(...$constraints)
);
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/MetadataRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function findBySettings(array $settings = []): QueryResultInterface

if (count($constraints)) {
$query->matching(
$query->logicalAnd(...array_values($constraints))
$query->logicalAnd(...$constraints)
);
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/TokenRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function deleteExpiredTokens(int $expireTime): void
$constraints[] = $query->lessThan('tstamp', (int) (time() - $expireTime));

if (count($constraints)) {
$query->matching($query->logicalAnd(...array_values($constraints)));
$query->matching($query->logicalAnd(...$constraints));
}

$tokensToBeRemoved = $query->execute();
Expand Down

0 comments on commit 9b73c2c

Please sign in to comment.