Skip to content

Commit 9050b32

Browse files
author
Kirill Nesmeyanov
committed
Optimize grammar logic
1 parent dfad4ab commit 9050b32

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

resources/grammar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@
343343
return new Node\Stmt\CallableTypeNode(
344344
name: $name,
345345
parameters: $parameters,
346-
type: isset($children[0]) ? $children[0] : null,
346+
type: $children[0] ?? null,
347347
);
348348
},
349349
61 => static function (\Phplrt\Parser\Context $ctx, $children) {

resources/grammar/callable.pp2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CallableType -> {
1313
return new Node\Stmt\CallableTypeNode(
1414
name: $name,
1515
parameters: $parameters,
16-
type: isset($children[0]) ? $children[0] : null,
16+
type: $children[0] ?? null,
1717
);
1818
}
1919
: Name()

0 commit comments

Comments
 (0)