diff --git a/src/Nodes/SVGNode.php b/src/Nodes/SVGNode.php index 2ec4557..ed76718 100644 --- a/src/Nodes/SVGNode.php +++ b/src/Nodes/SVGNode.php @@ -189,6 +189,20 @@ public function getAttribute(string $name): ?string return $this->attributes[$name] ?? null; } + /** + * Defines multiple attributes on this node at same time. + * + * @see SVGNode::setAttribute(); + * + * @return $this This node instance, for call chaining. + */ + public function setAttributes(array $attributes): SVGNode { + foreach ($attributes as $name => $value) { + $this->setAttribute($name, $value); + } + return $this; + } + /** * Defines an attribute on this node. A value of null will unset the * attribute. Note that the empty string is perfectly valid.