diff --git a/Node/FunctionNode.php b/Node/FunctionNode.php index 8428bac..938a82b 100644 --- a/Node/FunctionNode.php +++ b/Node/FunctionNode.php @@ -64,9 +64,7 @@ public function getSpecificity(): Specificity public function __toString(): string { - $arguments = implode(', ', array_map(function (Token $token) { - return "'".$token->getValue()."'"; - }, $this->arguments)); + $arguments = implode(', ', array_map(fn (Token $token) => "'".$token->getValue()."'", $this->arguments)); return sprintf('%s[%s:%s(%s)]', $this->getNodeName(), $this->selector, $this->name, $arguments ? '['.$arguments.']' : ''); } diff --git a/Parser/Parser.php b/Parser/Parser.php index d611efe..101df57 100644 --- a/Parser/Parser.php +++ b/Parser/Parser.php @@ -57,9 +57,7 @@ public static function parseSeries(array $tokens): array } } - $joined = trim(implode('', array_map(function (Token $token) { - return $token->getValue(); - }, $tokens))); + $joined = trim(implode('', array_map(fn (Token $token) => $token->getValue(), $tokens))); $int = function ($string) { if (!is_numeric($string)) { diff --git a/Tests/Parser/ParserTest.php b/Tests/Parser/ParserTest.php index 48a67f5..919357b 100644 --- a/Tests/Parser/ParserTest.php +++ b/Tests/Parser/ParserTest.php @@ -25,9 +25,7 @@ public function testParser($source, $representation) { $parser = new Parser(); - $this->assertEquals($representation, array_map(function (SelectorNode $node) { - return (string) $node->getTree(); - }, $parser->parse($source))); + $this->assertEquals($representation, array_map(fn (SelectorNode $node) => (string) $node->getTree(), $parser->parse($source))); } /** @dataProvider getParserExceptionTestData */