mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
gen_stub: stop cloning Type
objects
They are immutable
This commit is contained in:
parent
cecbcd9f3f
commit
8485a804ab
1 changed files with 2 additions and 7 deletions
|
@ -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 {
|
class Type {
|
||||||
/** @var SimpleType[] */
|
/** @var SimpleType[] */
|
||||||
public /* readonly */ array $types;
|
public /* readonly */ array $types;
|
||||||
|
@ -3146,13 +3148,6 @@ class PropertyInfo extends VariableLike
|
||||||
$fieldsynopsisElement->appendChild($doc->createElement("modifier", "readonly"));
|
$fieldsynopsisElement->appendChild($doc->createElement("modifier", "readonly"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __clone()
|
|
||||||
{
|
|
||||||
if ($this->type) {
|
|
||||||
$this->type = clone $this->type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class EnumCaseInfo {
|
class EnumCaseInfo {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue