Skip to content

Commit f0d6151

Browse files
committed
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.
1 parent 2b677aa commit f0d6151

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

build/gen_stub.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,7 @@ function initPhpParser() {
18701870
/** @var FuncInfo $funcInfo */
18711871
$funcMap[$funcInfo->name->__toString()] = $funcInfo;
18721872

1873+
// TODO: Don't use aliasMap for methodsynopsis?
18731874
if ($funcInfo->aliasType === "alias") {
18741875
$aliasMap[$funcInfo->alias->__toString()] = $funcInfo;
18751876
}
@@ -1879,7 +1880,11 @@ function initPhpParser() {
18791880
if ($verify) {
18801881
$errors = [];
18811882

1882-
foreach ($aliasMap as $aliasFunc) {
1883+
foreach ($funcMap as $aliasFunc) {
1884+
if ($aliasFunc->aliasType !== "alias") {
1885+
continue;
1886+
}
1887+
18831888
if (!isset($funcMap[$aliasFunc->alias->__toString()])) {
18841889
$errors[] = "Aliased function {$aliasFunc->alias}() cannot be found";
18851890
continue;

ext/standard/basic_functions_arginfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 21e54280829776de72313b96e38ad2aee60bd0ee */
2+
* Stub hash: 4e471966d507762dd6fdd2fc4200c8430fac97f4 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
55
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)

0 commit comments

Comments
 (0)