Skip to content

Commit

Permalink
minor #1137 Remove redundant u() from PostRepository::extractSearchTe…
Browse files Browse the repository at this point in the history
…rms() (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()
  • Loading branch information
javiereguiluz committed Jul 31, 2020
2 parents bcdd588 + 5c58163 commit e1dffb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Repository/PostRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ public function findBySearchQuery(string $query, int $limit = Post::NUM_ITEMS):
private function extractSearchTerms(string $searchQuery): array
{
$searchQuery = u($searchQuery)->replaceMatches('/[[:space:]]+/', ' ')->trim();
$terms = array_unique(u($searchQuery)->split(' '));
$terms = array_unique($searchQuery->split(' '));

// ignore the search terms that are too short
return array_filter($terms, function ($term) {
return 2 <= u($term)->length();
return 2 <= $term->length();
});
}
}

0 comments on commit e1dffb2

Please sign in to comment.