Skip to content

Commit

Permalink
fix(expr): replace literals case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Dec 27, 2019
1 parent cde7fb8 commit a5c179f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ protected function normalizeExpr(string $expr): string
return static::$expressions[$expr];
}

$expr = \preg_replace('~\s+~', ' ', \strtr($expr, static::$literals));
$expr = \preg_replace('~\s+~', ' ', $expr);
$count = \substr_count($expr, ' ');

if ($count < 4 || $count > 5) {
Expand All @@ -180,6 +180,6 @@ protected function normalizeExpr(string $expr): string
);
}

return $expr;
return \str_ireplace(\array_keys(static::$literals), \array_values(static::$literals), $expr);
}
}

0 comments on commit a5c179f

Please sign in to comment.