File tree 1 file changed +2
-10
lines changed
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -2085,9 +2085,6 @@ public function __clone()
2085
2085
$this->args[$key] = clone $argInfo;
2086
2086
}
2087
2087
$this->return = clone $this->return;
2088
- foreach ($this->attributes as $key => $attribute) {
2089
- $this->attributes[$key] = clone $attribute;
2090
- }
2091
2088
foreach ($this->framelessFunctionInfos as $key => $framelessFunctionInfo) {
2092
2089
$this->framelessFunctionInfos[$key] = clone $framelessFunctionInfo;
2093
2090
}
@@ -3151,9 +3148,6 @@ public function __clone()
3151
3148
if ($this->type) {
3152
3149
$this->type = clone $this->type;
3153
3150
}
3154
- foreach ($this->attributes as $key => $attribute) {
3155
- $this->attributes[$key] = clone $attribute;
3156
- }
3157
3151
}
3158
3152
}
3159
3153
@@ -3183,6 +3177,8 @@ public function getDeclaration(array $allConstInfos): string {
3183
3177
}
3184
3178
}
3185
3179
3180
+ // Instances of AttributeInfo are immutable and do not need to be cloned
3181
+ // when held by an object that is cloned
3186
3182
class AttributeInfo {
3187
3183
public /* readonly */ string $class;
3188
3184
/** @var \PhpParser\Node\Arg[] */
@@ -4012,10 +4008,6 @@ public function __clone()
4012
4008
foreach ($this->funcInfos as $key => $funcInfo) {
4013
4009
$this->funcInfos[$key] = clone $funcInfo;
4014
4010
}
4015
-
4016
- foreach ($this->attributes as $key => $attribute) {
4017
- $this->attributes[$key] = clone $attribute;
4018
- }
4019
4011
}
4020
4012
4021
4013
/**
You can’t perform that action at this time.
0 commit comments