From bcbbc77ab5a2caf328e729b7ea3f07e1f20cbb7f Mon Sep 17 00:00:00 2001 From: Rodrigo Butzke Date: Thu, 21 Aug 2025 17:53:30 -0300 Subject: [PATCH] SVGNode::setAttributes(); --- src/Nodes/SVGNode.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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.