mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Backport methodsynopsis role attributes changes from master
Commits93605f286d
andd6651426f4
This commit is contained in:
parent
0fc60fab72
commit
6aa5e58414
1 changed files with 8 additions and 10 deletions
|
@ -1487,14 +1487,10 @@ class FuncInfo {
|
|||
|
||||
$methodSynopsis = $doc->createElement($synopsisType);
|
||||
|
||||
$aliasedFunc = $this->aliasType === "alias" && isset($funcMap[$this->alias->__toString()]) ? $funcMap[$this->alias->__toString()] : null;
|
||||
$aliasFunc = $aliasMap[$this->name->__toString()] ?? null;
|
||||
|
||||
if (($this->aliasType === "alias" && $aliasedFunc !== null && $aliasedFunc->isMethod() !== $this->isMethod()) ||
|
||||
($aliasFunc !== null && $aliasFunc->isMethod() !== $this->isMethod())
|
||||
) {
|
||||
if ($this->isMethod()) {
|
||||
assert($this->name instanceof MethodName);
|
||||
$role = $doc->createAttribute("role");
|
||||
$role->value = $this->isMethod() ? "oop" : "procedural";
|
||||
$role->value = addslashes($this->name->className->__toString());
|
||||
$methodSynopsis->appendChild($role);
|
||||
}
|
||||
|
||||
|
@ -2766,11 +2762,12 @@ class ClassInfo {
|
|||
$classSynopsis->appendChild($classSynopsisInfo);
|
||||
|
||||
$classReference = self::getClassSynopsisReference($this->name);
|
||||
$escapedName = addslashes($this->name->__toString());
|
||||
|
||||
$classSynopsis->appendChild(new DOMText("\n "));
|
||||
$includeElement = $this->createIncludeElement(
|
||||
$doc,
|
||||
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[not(@role='procedural')])"
|
||||
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='$escapedName'])"
|
||||
);
|
||||
$classSynopsis->appendChild($includeElement);
|
||||
|
||||
|
@ -2778,7 +2775,7 @@ class ClassInfo {
|
|||
$classSynopsis->appendChild(new DOMText("\n "));
|
||||
$includeElement = $this->createIncludeElement(
|
||||
$doc,
|
||||
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])"
|
||||
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='$escapedName'])"
|
||||
);
|
||||
$classSynopsis->appendChild($includeElement);
|
||||
}
|
||||
|
@ -2787,7 +2784,7 @@ class ClassInfo {
|
|||
$classSynopsis->appendChild(new DOMText("\n "));
|
||||
$includeElement = $this->createIncludeElement(
|
||||
$doc,
|
||||
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[not(@role='procedural')])"
|
||||
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[@role='$escapedName'])"
|
||||
);
|
||||
$classSynopsis->appendChild($includeElement);
|
||||
}
|
||||
|
@ -2801,6 +2798,7 @@ class ClassInfo {
|
|||
foreach ($parentsWithInheritedMethods as $parent) {
|
||||
$classSynopsis->appendChild(new DOMText("\n "));
|
||||
$parentReference = self::getClassSynopsisReference($parent);
|
||||
$escapedParentName = addslashes($parent->__toString());
|
||||
$includeElement = $this->createIncludeElement(
|
||||
$doc,
|
||||
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$parentReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='$escapedParentName'])"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue