diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-10-07 11:34:14 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-10-07 11:34:14 +0200 |
commit | 9c710b1d11bb200d75d295cb78143455403315a1 (patch) | |
tree | 51060b7131fd9b37b8d58797f8947b588f3de0d7 /build | |
parent | c11191e7943bfb630982b2d22603e5d1dc636c4d (diff) | |
download | php-git-9c710b1d11bb200d75d295cb78143455403315a1.tar.gz |
Support "static" type in gen_stub
Diffstat (limited to 'build')
-rwxr-xr-x | build/gen_stub.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/build/gen_stub.php b/build/gen_stub.php index 41542cf97b..f3e84c27fd 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -111,6 +111,11 @@ class SimpleType { public static function fromNode(Node $node) { if ($node instanceof Node\Name) { + if ($node->toLowerString() === 'static') { + // PHP internally considers "static" a builtin type. + return new SimpleType($node->toString(), true); + } + assert($node->isFullyQualified()); return new SimpleType($node->toString(), false); } @@ -147,6 +152,8 @@ class SimpleType { return "IS_ITERABLE"; case "mixed": return "IS_MIXED"; + case "static": + return "IS_STATIC"; default: throw new Exception("Not implemented: $this->name"); } @@ -175,6 +182,8 @@ class SimpleType { return "MAY_BE_CALLABLE"; case "mixed": return "MAY_BE_ANY"; + case "static": + return "MAY_BE_STATIC"; default: throw new Exception("Not implemented: $this->name"); } |