Skip to content

Commit a4e0626

Browse files
DanielEScherzerkocsismate
authored andcommitted
gen_stub: inline single-use VariableLike::addTypeToFieldSynopsis() method
Protected method not overridden in any subclasses, so could be made private, but the method is short enough and simple enough that it can just be inlined.
1 parent 6730cbf commit a4e0626

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

build/gen_stub.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,16 +2351,6 @@ abstract protected function getFieldSynopsisValueString(array $allConstInfos): ?
23512351

23522352
abstract public function discardInfoForOldPhpVersions(?int $minimumPhpVersionIdCompatibility): void;
23532353

2354-
protected function addTypeToFieldSynopsis(DOMDocument $doc, DOMElement $fieldsynopsisElement): void
2355-
{
2356-
$type = $this->phpDocType ?? $this->type;
2357-
2358-
if ($type) {
2359-
$fieldsynopsisElement->appendChild(new DOMText("\n "));
2360-
$fieldsynopsisElement->appendChild($type->getTypeForDoc($doc));
2361-
}
2362-
}
2363-
23642354
/**
23652355
* @return array<int, string[]>
23662356
*/
@@ -2439,7 +2429,11 @@ public function getFieldSynopsisElement(DOMDocument $doc, array $allConstInfos):
24392429

24402430
$this->addModifiersToFieldSynopsis($doc, $fieldsynopsisElement);
24412431

2442-
$this->addTypeToFieldSynopsis($doc, $fieldsynopsisElement);
2432+
$type = $this->phpDocType ?? $this->type;
2433+
if ($type) {
2434+
$fieldsynopsisElement->appendChild(new DOMText("\n "));
2435+
$fieldsynopsisElement->appendChild($type->getTypeForDoc($doc));
2436+
}
24432437

24442438
$varnameElement = $doc->createElement("varname", $this->getFieldSynopsisName());
24452439
if ($this->link) {

0 commit comments

Comments
 (0)