diff --git a/build/gen_stub.php b/build/gen_stub.php index 945f9aa5487..6af9e06d16a 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -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'])"