Skip to content

Commit 8afc558

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Replace another root XML element format to the "canonical" one Remove the superfluous closing parentheses from class synopsis page includes Always include the constructor on the class manual pages Backport methodsynopsis role attributes changes from master
2 parents b9cd1cd + 6aa5e58 commit 8afc558

File tree

1 file changed

+36
-38
lines changed

1 file changed

+36
-38
lines changed

build/gen_stub.php

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,41 +2756,37 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, itera
27562756
"&InheritedProperties;"
27572757
);
27582758

2759-
if (!empty($this->funcInfos)) {
2760-
$classSynopsis->appendChild(new DOMText("\n\n "));
2761-
$classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&Methods;");
2762-
$classSynopsisInfo->setAttribute("role", "comment");
2763-
$classSynopsis->appendChild($classSynopsisInfo);
2759+
$classSynopsis->appendChild(new DOMText("\n\n "));
2760+
$classSynopsisInfo = $doc->createElement("classsynopsisinfo", "&Methods;");
2761+
$classSynopsisInfo->setAttribute("role", "comment");
2762+
$classSynopsis->appendChild($classSynopsisInfo);
27642763

2765-
$classReference = self::getClassSynopsisReference($this->name);
2766-
$escapedName = addslashes($this->name->__toString());
2764+
$classReference = self::getClassSynopsisReference($this->name);
2765+
$escapedName = addslashes($this->name->__toString());
27672766

2768-
if ($this->hasConstructor()) {
2769-
$classSynopsis->appendChild(new DOMText("\n "));
2770-
$includeElement = $this->createIncludeElement(
2771-
$doc,
2772-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='$escapedName'])"
2773-
);
2774-
$classSynopsis->appendChild($includeElement);
2775-
}
2767+
$classSynopsis->appendChild(new DOMText("\n "));
2768+
$includeElement = $this->createIncludeElement(
2769+
$doc,
2770+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='$escapedName'])"
2771+
);
2772+
$classSynopsis->appendChild($includeElement);
27762773

2777-
if ($this->hasMethods()) {
2778-
$classSynopsis->appendChild(new DOMText("\n "));
2779-
$includeElement = $this->createIncludeElement(
2780-
$doc,
2781-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='$escapedName'])"
2782-
);
2783-
$classSynopsis->appendChild($includeElement);
2784-
}
2774+
if ($this->hasMethods()) {
2775+
$classSynopsis->appendChild(new DOMText("\n "));
2776+
$includeElement = $this->createIncludeElement(
2777+
$doc,
2778+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='$escapedName'])"
2779+
);
2780+
$classSynopsis->appendChild($includeElement);
2781+
}
27852782

2786-
if ($this->hasDestructor()) {
2787-
$classSynopsis->appendChild(new DOMText("\n "));
2788-
$includeElement = $this->createIncludeElement(
2789-
$doc,
2790-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[@role='$escapedName'])"
2791-
);
2792-
$classSynopsis->appendChild($includeElement);
2793-
}
2783+
if ($this->hasDestructor()) {
2784+
$classSynopsis->appendChild(new DOMText("\n "));
2785+
$includeElement = $this->createIncludeElement(
2786+
$doc,
2787+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[@role='$escapedName'])"
2788+
);
2789+
$classSynopsis->appendChild($includeElement);
27942790
}
27952791

27962792
if (!empty($parentsWithInheritedMethods)) {
@@ -2805,7 +2801,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, itera
28052801
$escapedParentName = addslashes($parent->__toString());
28062802
$includeElement = $this->createIncludeElement(
28072803
$doc,
2808-
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$parentReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='$escapedParentName')])"
2804+
"xmlns(db=http://docbook.org/ns/docbook) xpointer(id('$parentReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='$escapedParentName'])"
28092805
);
28102806
$classSynopsis->appendChild($includeElement);
28112807
}
@@ -4262,16 +4258,18 @@ function replaceClassSynopses(string $targetDirectory, array $classMap, iterable
42624258
$replacedXml = preg_replace(
42634259
[
42644260
"/REPLACED-ENTITY-([A-Za-z0-9._{}%-]+?;)/",
4265-
"/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc=\"([a-z0-9.:\/]+)\"\s+xmlns=\"([a-z0-9.:\/]+)\"\s+xml:id=\"([a-z0-9._-]+)\"\s*>/i",
4266-
"/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc=\"([a-z0-9.:\/]+)\"\s+xmlns=\"([a-z0-9.:\/]+)\"\s+xmlns:xi=\"([a-z0-9.:\/]+)\"\s+xml:id=\"([a-z0-9._-]+)\"\s*>/i",
4267-
"/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc=\"([a-z0-9.:\/]+)\"\s+xmlns=\"([a-z0-9.:\/]+)\"\s+xmlns:xlink=\"([a-z0-9.:\/]+)\"\s+xmlns:xi=\"([a-z0-9.:\/]+)\"\s+xml:id=\"([a-z0-9._-]+)\"\s*>/i",
4268-
"/<phpdoc:(classref|exceptionref)\s+xmlns=\"([a-z0-9.:\/]+)\"\s+xmlns:xlink=\"([a-z0-9.:\/]+)\"\s+xmlns:xi=\"([a-z0-9.:\/]+)\"\s+xmlns:phpdoc=\"([a-z0-9.:\/]+)\"\s+xml:id=\"([a-z0-9._-]+)\"\s*>/i",
4261+
'/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc=\"([^"]+)"\s+xmlns="([^"]+)"\s+xml:id="([^"]+)"\s*>/i',
4262+
'/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc=\"([^"]+)"\s+xmlns="([^"]+)"\s+xmlns:xi="([^"]+)"\s+xml:id="([^"]+)"\s*>/i',
4263+
'/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc=\"([^"]+)"\s+xmlns="([^"]+)"\s+xmlns:xlink="([^"]+)"\s+xmlns:xi="([^"]+)"\s+xml:id="([^"]+)"\s*>/i',
4264+
'/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc=\"([^"]+)"\s+xmlns:xlink="([^"]+)"\s+xmlns:xi="([^"]+)"\s+xmlns="([^"]+)"\s+xml:id="([^"]+)"\s*>/i',
4265+
'/<phpdoc:(classref|exceptionref)\s+xmlns=\"([^"]+)\"\s+xmlns:xlink="([^"]+)"\s+xmlns:xi="([^"]+)"\s+xmlns:phpdoc="([^"]+)"\s+xml:id="([^"]+)"\s*>/i',
42694266
],
42704267
[
42714268
"&$1",
42724269
"<phpdoc:$1 xml:id=\"$4\" xmlns:phpdoc=\"$2\" xmlns=\"$3\">",
42734270
"<phpdoc:$1 xml:id=\"$5\" xmlns:phpdoc=\"$2\" xmlns=\"$3\" xmlns:xi=\"$4\">",
42744271
"<phpdoc:$1 xml:id=\"$6\" xmlns:phpdoc=\"$2\" xmlns=\"$3\" xmlns:xlink=\"$4\" xmlns:xi=\"$5\">",
4272+
"<phpdoc:$1 xml:id=\"$6\" xmlns:phpdoc=\"$2\" xmlns=\"$5\" xmlns:xlink=\"$3\" xmlns:xi=\"$4\">",
42754273
"<phpdoc:$1 xml:id=\"$6\" xmlns:phpdoc=\"$5\" xmlns=\"$2\" xmlns:xlink=\"$3\" xmlns:xi=\"$4\">",
42764274
],
42774275
$replacedXml
@@ -4495,8 +4493,8 @@ function replaceMethodSynopses(string $targetDirectory, array $funcMap, array $a
44954493
$replacedXml = preg_replace(
44964494
[
44974495
"/REPLACED-ENTITY-([A-Za-z0-9._{}%-]+?;)/",
4498-
"/<refentry\s+xmlns=\"([a-z0-9.:\/]+)\"\s+xml:id=\"([a-z0-9._-]+)\"\s*>/i",
4499-
"/<refentry\s+xmlns=\"([a-z0-9.:\/]+)\"\s+xmlns:xlink=\"([a-z0-9.:\/]+)\"\s+xml:id=\"([a-z0-9._-]+)\"\s*>/i",
4496+
'/<refentry\s+xmlns="([^"]+)"\s+xml:id="([^"]+)"\s*>/i',
4497+
'/<refentry\s+xmlns="([^"]+)"\s+xmlns:xlink="([^"]+)"\s+xml:id="([^"]+)"\s*>/i',
45004498
],
45014499
[
45024500
"&$1",

0 commit comments

Comments
 (0)