Commit e56fe5165d1 for php
commit e56fe5165d1ed4e67407911cfe98c55b615f86d6
Author: Jordi Kroon <jkroon@onyourmarks.agency>
Date: Tue Dec 1 21:19:47 2026 +0100
gen_stub: Skip non-refentry documents and manual synopses in stub generation (#25883)
diff --git a/build/gen_stub.php b/build/gen_stub.php
index 763b82bc230..f40872daaba 100755
--- a/build/gen_stub.php
+++ b/build/gen_stub.php
@@ -6138,6 +6138,11 @@ function replaceMethodSynopses(
continue;
}
+ // Only function and method pages are regenerated
+ if ($doc->documentElement->nodeName !== "refentry") {
+ continue;
+ }
+
$methodSynopsisElements = [];
foreach ($doc->getElementsByTagName("constructorsynopsis") as $element) {
$methodSynopsisElements[] = $element;
@@ -6166,6 +6171,11 @@ function replaceMethodSynopses(
$funcInfo = $funcMap[$funcName];
$documentedFuncMap[$funcInfo->name->__toString()] = $funcInfo->name->__toString();
+ // Hand-maintained synopses are never regenerated
+ if ($methodSynopsis->getAttribute("condition") === "stub-override") {
+ continue;
+ }
+
$newMethodSynopsis = $funcInfo->getMethodSynopsisElement($doc);
if ($newMethodSynopsis === null) {
continue;