Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -4261,6 +4261,11 @@ private function handleStatements(array $stmts, PrettyPrinterAbstract $prettyPri
continue;
}

if ($stmt instanceof Stmt\Use_ || $stmt instanceof Stmt\GroupUse) {
// use statements are resolved by NameResolver before this point
continue;
}

if ($stmt instanceof Stmt\Const_) {
foreach ($stmt->consts as $const) {
$this->constInfos[] = parseConstLike(
Expand Down
7 changes: 7 additions & 0 deletions ext/zend_test/test.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,20 @@ public function method(): ?NotUnlikelyCompileError {}

namespace ZendTestNS2 {

use ZendTestNS\Foo as FooAlias;
use ZendTestNS\UnlikelyCompileError;
use ZendTestNS\{NotUnlikelyCompileError};

/** @var string */
const ZEND_CONSTANT_A = "namespaced";

class Foo {
public ZendSubNS\Foo $foo;
public ZendSubNS\Foo&\ZendTestNS\Bar $intersectionProp;
public ZendSubNS\Foo|\ZendTestNS\Bar $unionProp;
public FooAlias $fooAlias;
public UnlikelyCompileError $unlProp;
public NotUnlikelyCompileError $notUnlProp;

public function method(): void {}
}
Expand Down
23 changes: 22 additions & 1 deletion ext/zend_test/test_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ext/zend_test/test_decl.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion ext/zend_test/test_legacy_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions ext/zend_test/tests/gen_stub_test_01.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ object(ZendTestNS2\Foo)#%d (%d) {
uninitialized(ZendTestNS2\ZendSubNS\Foo&ZendTestNS\Bar)
["unionProp"]=>
uninitialized(ZendTestNS2\ZendSubNS\Foo|ZendTestNS\Bar)
["fooAlias"]=>
uninitialized(ZendTestNS\Foo)
["unlProp"]=>
uninitialized(ZendTestNS\UnlikelyCompileError)
["notUnlProp"]=>
uninitialized(ZendTestNS\NotUnlikelyCompileError)
}
object(ZendTestNS2\Foo)#%d (%d) {
["foo"]=>
Expand All @@ -31,6 +37,12 @@ object(ZendTestNS2\Foo)#%d (%d) {
uninitialized(ZendTestNS2\ZendSubNS\Foo&ZendTestNS\Bar)
["unionProp"]=>
uninitialized(ZendTestNS2\ZendSubNS\Foo|ZendTestNS\Bar)
["fooAlias"]=>
uninitialized(ZendTestNS\Foo)
["unlProp"]=>
uninitialized(ZendTestNS\UnlikelyCompileError)
["notUnlProp"]=>
uninitialized(ZendTestNS\NotUnlikelyCompileError)
}
object(ZendTestNS\UnlikelyCompileError)#%d (%d) {
}
Expand Down
Loading