diff --git a/src/Parser.php b/src/Parser.php index f3d6e50..c32395f 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -25,7 +25,7 @@ class Parser private array $macro = []; private array $variables = []; - public function __construct(Lexer $lexer = null) + public function __construct(?Lexer $lexer = null) { $this->lexer = $lexer ?: new Lexer(); } @@ -153,7 +153,7 @@ private function parseObject(): ObjectNode * KeyValueList ::= VariableAssignation|KeyValue [ Separator [ KeyValueList ] ] * KeyValue ::= ( ( T_END_STR | T_NAME ) OptionalAssignementOperator Value ) | MacroCall */ - private function parseInnerObject(ObjectNode $object = null): ObjectNode + private function parseInnerObject(?ObjectNode $object = null): ObjectNode { $object = $object ?: new ObjectNode(); do { diff --git a/tests/NaclTest.php b/tests/NaclTest.php index d32710a..127ef37 100644 --- a/tests/NaclTest.php +++ b/tests/NaclTest.php @@ -54,7 +54,7 @@ public function testNacl(string $naclFile, string $jsonFile): void $this->parser->registerMacro(new Macros\Callback('testMacroWithOptions', fn($p, $a = []) => [ 'param' => $p, - 'options' => $a + 'options' => $a, ])); $this->parser->registerMacro(new Macros\Callback('testMacro', fn($p, $a = []) => $p));