gen_stub: stop cloning Type objects

They are immutable
This commit is contained in:
Daniel Scherzer 2025-02-21 17:36:39 -08:00 committed by Máté Kocsis
parent cecbcd9f3f
commit 8485a804ab

View file

@ -531,6 +531,8 @@ class SimpleType {
}
}
// Instances of Type are immutable and do not need to be cloned
// when held by an object that is cloned
class Type {
/** @var SimpleType[] */
public /* readonly */ array $types;
@ -3146,13 +3148,6 @@ class PropertyInfo extends VariableLike
$fieldsynopsisElement->appendChild($doc->createElement("modifier", "readonly"));
}
}
public function __clone()
{
if ($this->type) {
$this->type = clone $this->type;
}
}
}
class EnumCaseInfo {