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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 "));