From a4e062600fc75cae1bb89f39e5b3fc794550cba4 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Fri, 4 Oct 2024 18:21:37 -0700 Subject: [PATCH] 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. --- build/gen_stub.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index a4ab8492bad..cee55d2643a 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -2351,16 +2351,6 @@ abstract class VariableLike abstract public function discardInfoForOldPhpVersions(?int $minimumPhpVersionIdCompatibility): void; - protected function addTypeToFieldSynopsis(DOMDocument $doc, DOMElement $fieldsynopsisElement): void - { - $type = $this->phpDocType ?? $this->type; - - if ($type) { - $fieldsynopsisElement->appendChild(new DOMText("\n ")); - $fieldsynopsisElement->appendChild($type->getTypeForDoc($doc)); - } - } - /** * @return array */ @@ -2439,7 +2429,11 @@ abstract class VariableLike $this->addModifiersToFieldSynopsis($doc, $fieldsynopsisElement); - $this->addTypeToFieldSynopsis($doc, $fieldsynopsisElement); + $type = $this->phpDocType ?? $this->type; + if ($type) { + $fieldsynopsisElement->appendChild(new DOMText("\n ")); + $fieldsynopsisElement->appendChild($type->getTypeForDoc($doc)); + } $varnameElement = $doc->createElement("varname", $this->getFieldSynopsisName()); if ($this->link) {