1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00

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.
This commit is contained in:
Daniel Scherzer
2024-10-04 18:21:37 -07:00
committed by Máté Kocsis
parent 6730cbfb25
commit a4e062600f
+5 -11
View File
@@ -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<int, string[]>
*/
@@ -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) {