Skip to content

Commit 47ef51c

Browse files
nikicremicollet
authored andcommitted
Add @generate-legacy-arginfo tag
1 parent 0f36981 commit 47ef51c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build/gen_stub.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function processStubFile(string $stubFile, Context $context) {
4949
echo "Saved $arginfoFile\n";
5050
}
5151

52-
if (file_exists($legacyFile)) {
52+
if ($fileInfo->generateLegacyArginfo) {
5353
foreach ($fileInfo->getAllFuncInfos() as $funcInfo) {
5454
$funcInfo->discardInfoForOldPhpVersions();
5555
}
@@ -633,6 +633,8 @@ class FileInfo {
633633
public $generateFunctionEntries = false;
634634
/** @var string */
635635
public $declarationPrefix = "";
636+
/** @var bool */
637+
public $generateLegacyArginfo = false;
636638

637639
/**
638640
* @return iterable<FuncInfo>
@@ -955,6 +957,8 @@ protected function pName_FullyQualified(Name\FullyQualified $node) {
955957
if ($tag->name === 'generate-function-entries') {
956958
$fileInfo->generateFunctionEntries = true;
957959
$fileInfo->declarationPrefix = $tag->value ? $tag->value . " " : "";
960+
} else if ($tag->name === 'generate-legacy-arginfo') {
961+
$fileInfo->generateLegacyArginfo = true;
958962
}
959963
}
960964
}

0 commit comments

Comments
 (0)