1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Add support for non-parameter attribute rendering in stubs (#16926)

This commit is contained in:
Máté Kocsis
2024-11-26 13:47:09 +01:00
committed by GitHub
parent 90b66edbca
commit 02c2cfaaf3

View File

@@ -2086,6 +2086,13 @@ OUPUT_EXAMPLE
$methodSynopsis->appendChild(new DOMText("\n "));
foreach ($this->attributes as $attribute) {
$modifier = $doc->createElement("modifier", "#[\\" . $attribute->class . "]");
$modifier->setAttribute("role", "attribute");
$methodSynopsis->appendChild($modifier);
$methodSynopsis->appendChild(new DOMText("\n "));
}
foreach ($this->getModifierNames() as $modifierString) {
$modifierElement = $doc->createElement('modifier', $modifierString);
$methodSynopsis->appendChild($modifierElement);
@@ -3870,6 +3877,13 @@ class ClassInfo {
$ooElement->appendChild($doc->createElement('modifier', $modifierOverride));
$ooElement->appendChild(new DOMText("\n$indentation "));
} elseif ($withModifiers) {
foreach ($classInfo->attributes as $attribute) {
$modifier = $doc->createElement("modifier", "#[\\" . $attribute->class . "]");
$modifier->setAttribute("role", "attribute");
$ooElement->appendChild($modifier);
$ooElement->appendChild(new DOMText("\n$indentation "));
}
if ($classInfo->flags & Modifiers::FINAL) {
$ooElement->appendChild($doc->createElement('modifier', 'final'));
$ooElement->appendChild(new DOMText("\n$indentation "));