Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Nodes/SVGNodeContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ public function __construct()
$this->children = [];
}

/**
* Inserts multiple SVGNodes at same time
*
* @see SVGNodeContainer::addChild();
*
* @return $this This node instance, for call chaining.
*/
public function addChildren(array $nodes, ?array $indexes = null): SVGNodeContainer
{
foreach ($nodes as $k=> $node) {
$this->addChild($node, $indexes[$k] ?? null);
}
return $this;
}

/**
* Inserts an SVGNode instance at the given index, or, if no index is given,
* at the end of the child list.
Expand Down