From 6cdea31bc29e2bdbb2574ee0678e71cb42c4761b Mon Sep 17 00:00:00 2001 From: Romain Canon Date: Mon, 29 Nov 2021 11:18:06 +0100 Subject: [PATCH] fix: filter type symbols with strict string comparison Previously, `array_filter` would remove the integer value `0` from the array. See #1 --- src/Type/Parser/LexingParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Type/Parser/LexingParser.php b/src/Type/Parser/LexingParser.php index ad0d66a9..6b35452f 100644 --- a/src/Type/Parser/LexingParser.php +++ b/src/Type/Parser/LexingParser.php @@ -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),