Skip to content

Commit

Permalink
fix: filter type symbols with strict string comparison
Browse files Browse the repository at this point in the history
Previously, `array_filter` would remove the integer value `0` from the
array.

See #1
  • Loading branch information
romm committed Nov 29, 2021
1 parent 396f64a commit 6cdea31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Type/Parser/LexingParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function parse(string $raw): Type
{
$symbols = $this->splitTokens($raw);
$symbols = array_map('trim', $symbols);
$symbols = array_filter($symbols);
$symbols = array_filter($symbols, static fn ($value) => $value !== '');

$tokens = array_map(
fn (string $symbol) => $this->lexer->tokenize($symbol),
Expand Down

0 comments on commit 6cdea31

Please sign in to comment.