Skip to content

Commit 495a43d

Browse files
committed
Merge branch 'PHP-8.6'
* PHP-8.6: gen_stub: do not add xi:fallback to generated xi:include elements (#25533)
2 parents 3b6070c + 2009bde commit 495a43d

1 file changed

Lines changed: 7 additions & 17 deletions

File tree

‎build/gen_stub.php‎

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,8 +3981,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, array
39813981
$classSynopsis->appendChild(new DOMText("\n$classSynopsisIndentation "));
39823982
$includeElement = $this->createIncludeElement(
39833983
$doc,
3984-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='$escapedName'])",
3985-
$classSynopsisIndentationLevel + 1
3984+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='$escapedName'])"
39863985
);
39873986
$classSynopsis->appendChild($includeElement);
39883987
}
@@ -3991,8 +3990,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, array
39913990
$classSynopsis->appendChild(new DOMText("\n$classSynopsisIndentation "));
39923991
$includeElement = $this->createIncludeElement(
39933992
$doc,
3994-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='$escapedName'])",
3995-
$classSynopsisIndentationLevel + 1
3993+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='$escapedName'])"
39963994
);
39973995
$classSynopsis->appendChild($includeElement);
39983996
}
@@ -4001,8 +3999,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, array
40013999
$classSynopsis->appendChild(new DOMText("\n$classSynopsisIndentation "));
40024000
$includeElement = $this->createIncludeElement(
40034001
$doc,
4004-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[@role='$escapedName'])",
4005-
$classSynopsisIndentationLevel + 1
4002+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[@role='$escapedName'])"
40064003
);
40074004
$classSynopsis->appendChild($includeElement);
40084005
}
@@ -4025,8 +4022,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, array
40254022
$classSynopsis->appendChild(new DOMText("\n$classSynopsisIndentation "));
40264023
$includeElement = $this->createIncludeElement(
40274024
$doc,
4028-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$parentReference')/db:refentry/db:refsect1[@role='description']/descendant::db:{$parentMethodsynopsisType}[@role='$escapedParentName'])",
4029-
$classSynopsisIndentationLevel + 1
4025+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$parentReference')/db:refentry/db:refsect1[@role='description']/descendant::db:{$parentMethodsynopsisType}[@role='$escapedParentName'])"
40304026
);
40314027

40324028
$classSynopsis->appendChild($includeElement);
@@ -4252,18 +4248,12 @@ public function getClassName(): string {
42524248
return $this->name->getLast();
42534249
}
42544250

4255-
private function createIncludeElement(DOMDocument $doc, string $query, int $indentationLevel): DOMElement
4251+
private function createIncludeElement(DOMDocument $doc, string $query): DOMElement
42564252
{
4257-
$indentation = str_repeat(" ", $indentationLevel);
4258-
42594253
$includeElement = $doc->createElement("xi:include");
42604254
$attr = $doc->createAttribute("xpointer");
42614255
$attr->value = $query;
42624256
$includeElement->appendChild($attr);
4263-
$fallbackElement = $doc->createElement("xi:fallback");
4264-
$includeElement->appendChild(new DOMText("\n$indentation "));
4265-
$includeElement->appendChild($fallbackElement);
4266-
$includeElement->appendChild(new DOMText("\n$indentation"));
42674257

42684258
return $includeElement;
42694259
}
@@ -4294,11 +4284,11 @@ private function appendInheritedMemberSectionToClassSynopsis(DOMDocument $doc, D
42944284
foreach ($parents as $parent) {
42954285
$classSynopsis->appendChild(new DOMText("\n$indentation"));
42964286
$parentReference = self::getClassSynopsisReference($parent);
4287+
$parentSynopsis = count($parent->getParts()) > 1 ?"db:packagesynopsis/db:classsynopsis" : "db:classsynopsis";
42974288

42984289
$includeElement = $this->createIncludeElement(
42994290
$doc,
4300-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$parentReference')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='$label']]))",
4301-
$indentationLevel
4291+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$parentReference')/db:partintro/db:section/$parentSynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='$label']]))"
43024292
);
43034293
$classSynopsis->appendChild($includeElement);
43044294
}

0 commit comments

Comments
 (0)