Skip to content

Commit e1dffb2

Browse files
committed
minor #1137 Remove redundant u() from PostRepository::extractSearchTerms() (jkufner)
This PR was merged into the master branch. Discussion ---------- Remove redundant u() from PostRepository::extractSearchTerms() These redundant `u()` cause type errors when using `declare(strict_types = 1)`. Commits ------- 5c58163 Remove redundant u() from PostRepository::extractSearchTerms()
2 parents bcdd588 + 5c58163 commit e1dffb2

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)