diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-01-18 16:01:16 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-01-18 16:04:14 +0100 |
commit | f0d6151918308cfc35171f6f6f6aeb832889c46e (patch) | |
tree | 1f81bd627b1c5d3a9fc9d8e81879d314357af8fe /build | |
parent | 2b677aaa34d59256d2bbb5b18a0f2bc670c4f72a (diff) | |
download | php-git-f0d6151918308cfc35171f6f6f6aeb832889c46e.tar.gz |
gen_stub: Don't use $aliasMap during verification
Some functions have multiple aliases, while the $aliasMap can
only record one.
Methodsynopsis generation probably shouldn't use it either, but
at least that case seems to only be interested in whether there
is an alias at all.
Diffstat (limited to 'build')
-rwxr-xr-x | build/gen_stub.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/build/gen_stub.php b/build/gen_stub.php index ee19f57a0c..f231307f2a 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -1870,6 +1870,7 @@ foreach ($fileInfos as $fileInfo) { /** @var FuncInfo $funcInfo */ $funcMap[$funcInfo->name->__toString()] = $funcInfo; + // TODO: Don't use aliasMap for methodsynopsis? if ($funcInfo->aliasType === "alias") { $aliasMap[$funcInfo->alias->__toString()] = $funcInfo; } @@ -1879,7 +1880,11 @@ foreach ($fileInfos as $fileInfo) { if ($verify) { $errors = []; - foreach ($aliasMap as $aliasFunc) { + foreach ($funcMap as $aliasFunc) { + if ($aliasFunc->aliasType !== "alias") { + continue; + } + if (!isset($funcMap[$aliasFunc->alias->__toString()])) { $errors[] = "Aliased function {$aliasFunc->alias}() cannot be found"; continue; |