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
14 changes: 14 additions & 0 deletions src/Nodes/SVGNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down