Misc fixes
This commit is contained in:
@@ -21,10 +21,9 @@ class ArrayNode extends Node implements CollapsibleNode
|
||||
$this->items = array_values($this->items);
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
public function __clone(): void
|
||||
{
|
||||
$items = array_map(fn($v) => clone $v, $this->items);
|
||||
return new ArrayNode($items);
|
||||
$this->items = array_map(fn($v) => clone $v, $this->items);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
|
||||
@@ -37,13 +37,12 @@ class ObjectNode extends Node implements CollapsibleNode
|
||||
unset($this->properties[$key]);
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
public function __clone(): void
|
||||
{
|
||||
$properties = array_combine(
|
||||
$this->properties = array_combine(
|
||||
array_keys($this->properties),
|
||||
array_map(fn($v) => clone $v, $this->properties)
|
||||
);
|
||||
return new ObjectNode($properties);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
|
||||
Reference in New Issue
Block a user