Skip to content

Commit fc6a33a

Browse files
committed
fix bug
1 parent 540a846 commit fc6a33a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ASTConverter/ASTConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ private static function _init_handle_map() : array {
757757
\ast\AST_NAMESPACE,
758758
0,
759759
[
760-
'name' => self::_phpparser_name_to_string($n->name),
760+
'name' => $n->name !== null ? self::_phpparser_name_to_string($n->name) : null,
761761
'stmts' => isset($n->stmts) ? self::_phpparser_stmtlist_to_ast_node($n->stmts, $startLine) : null,
762762
],
763763
$startLine

test_files/src/namespace.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66
namespace MyNS\Baz {
77
function BazFunction() { }
88
}
9+
namespace {
10+
function xFunction() { }
11+
}

0 commit comments

Comments
 (0)