Skip to content

Commit

Permalink
Add support for non-parameter attribute rendering in stubs (#16926)
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate authored Nov 26, 2024
1 parent 90b66ed commit 02c2cfa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -2086,6 +2086,13 @@ public function getMethodSynopsisElement(array $funcMap, array $aliasMap, DOMDoc

$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);
Expand Down Expand Up @@ -3870,6 +3877,13 @@ private static function createOoElement(
$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 "));
Expand Down

0 comments on commit 02c2cfa

Please sign in to comment.