File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -2085,9 +2085,6 @@ public function __clone()
20852085 $this->args[$key] = clone $argInfo;
20862086 }
20872087 $this->return = clone $this->return;
2088- foreach ($this->attributes as $key => $attribute) {
2089- $this->attributes[$key] = clone $attribute;
2090- }
20912088 foreach ($this->framelessFunctionInfos as $key => $framelessFunctionInfo) {
20922089 $this->framelessFunctionInfos[$key] = clone $framelessFunctionInfo;
20932090 }
@@ -3151,9 +3148,6 @@ public function __clone()
31513148 if ($this->type) {
31523149 $this->type = clone $this->type;
31533150 }
3154- foreach ($this->attributes as $key => $attribute) {
3155- $this->attributes[$key] = clone $attribute;
3156- }
31573151 }
31583152}
31593153
@@ -3183,6 +3177,8 @@ public function getDeclaration(array $allConstInfos): string {
31833177 }
31843178}
31853179
3180+ // Instances of AttributeInfo are immutable and do not need to be cloned
3181+ // when held by an object that is cloned
31863182class AttributeInfo {
31873183 public /* readonly */ string $class;
31883184 /** @var \PhpParser\Node\Arg[] */
@@ -4012,10 +4008,6 @@ public function __clone()
40124008 foreach ($this->funcInfos as $key => $funcInfo) {
40134009 $this->funcInfos[$key] = clone $funcInfo;
40144010 }
4015-
4016- foreach ($this->attributes as $key => $attribute) {
4017- $this->attributes[$key] = clone $attribute;
4018- }
40194011 }
40204012
40214013 /**
You can’t perform that action at this time.
0 commit comments