Skip to content

Commit

Permalink
Applied code review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
kisztof authored and mikadamczyk committed Dec 13, 2023
1 parent d3cc6c4 commit 0dcb48a
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,9 @@ protected function tokenizeString($string)
*/
protected function getWordExpression(QueryBuilder $query, string $token): string
{
if ($this->configuration['enableWildcards'] && str_contains($token, '*')) {
$hasLeadingWildcard = str_starts_with($token, '*');
$hasTrailingWildcard = str_ends_with($token, '*');

$hasLeadingWildcard = str_starts_with($token, '*');
$hasTrailingWildcard = str_ends_with($token, '*');
if ($this->configuration['enableWildcards'] && ($hasLeadingWildcard || $hasTrailingWildcard)) {
$token = $hasLeadingWildcard ? substr($token, 1) : $token;
$token = $hasTrailingWildcard ? substr($token, 0, -1) : $token;

Expand Down

0 comments on commit 0dcb48a

Please sign in to comment.