Only use array_merge if we have arguments

parent 271ea631
......@@ -81,7 +81,7 @@ final class NodeCollection
$self = new self();
$self->name = $name ?: uniqid('', true);
$self->nodeList = array_merge(...$nodeList);
$self->nodeList = !empty($nodeList) ? array_merge(...$nodeList) : [];
return $self;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment