Skip to content

Commit 5c58163

Browse files
committed
Remove redundant u() from PostRepository::extractSearchTerms()
These redundant u() cause type errors when using declare(strict_types = 1).
1 parent 1d809c2 commit 5c58163

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Repository/PostRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ public function findBySearchQuery(string $query, int $limit = Post::NUM_ITEMS):
8787
private function extractSearchTerms(string $searchQuery): array
8888
{
8989
$searchQuery = u($searchQuery)->replaceMatches('/[[:space:]]+/', ' ')->trim();
90-
$terms = array_unique(u($searchQuery)->split(' '));
90+
$terms = array_unique($searchQuery->split(' '));
9191

9292
// ignore the search terms that are too short
9393
return array_filter($terms, function ($term) {
94-
return 2 <= u($term)->length();
94+
return 2 <= $term->length();
9595
});
9696
}
9797
}

0 commit comments

Comments
 (0)