diff --git a/src/main/php/lang/ast/syntax/PHP.class.php b/src/main/php/lang/ast/syntax/PHP.class.php index 430fe4a..3f22be3 100755 --- a/src/main/php/lang/ast/syntax/PHP.class.php +++ b/src/main/php/lang/ast/syntax/PHP.class.php @@ -603,6 +603,10 @@ public function __construct() { $names[$import]= $parse->token->value; $parse->scope->import($import, $parse->token->value); $parse->forward(); + } else if ('=' === $parse->token->value) { + $parse->forward(); + $type= 'type'; + $names[$import]= $this->type($parse, false); } else { $names[$import]= null; $parse->scope->import($import); diff --git a/src/test/php/lang/ast/unittest/parse/NamespacesTest.class.php b/src/test/php/lang/ast/unittest/parse/NamespacesTest.class.php index 0266cfd..243a16c 100755 --- a/src/test/php/lang/ast/unittest/parse/NamespacesTest.class.php +++ b/src/test/php/lang/ast/unittest/parse/NamespacesTest.class.php @@ -1,6 +1,7 @@ assertParsed( + [new UseStatement('type', ['Name' => new IsUnion([new IsLiteral('string'), new IsLiteral('null')])], self::LINE)], + 'use Name = string|null;' + ); + } } \ No newline at end of file