mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +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:
parent
6730cbfb25
commit
a4e062600f
1 changed files with 5 additions and 11 deletions
|
@ -2351,16 +2351,6 @@ abstract class VariableLike
|
||||||
|
|
||||||
abstract public function discardInfoForOldPhpVersions(?int $minimumPhpVersionIdCompatibility): void;
|
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[]>
|
* @return array<int, string[]>
|
||||||
*/
|
*/
|
||||||
|
@ -2439,7 +2429,11 @@ abstract class VariableLike
|
||||||
|
|
||||||
$this->addModifiersToFieldSynopsis($doc, $fieldsynopsisElement);
|
$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());
|
$varnameElement = $doc->createElement("varname", $this->getFieldSynopsisName());
|
||||||
if ($this->link) {
|
if ($this->link) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue