src/Nodes/SVGNode.php
public function setAttribute($name, $value)
    {
        if (!isset($value)) {
            unset($this->attributes[$name]);
            return $this;
        }
        $this->attributes[$name] = (string) $value;
        return $this;
    }
public function setAttribute($name, $value)
    {
        if (!isset($value)) {
            unset($this->attributes[$name]);
            return $this;
        }
        $this->attributes[$name] = (string) $value;
        return $this;
    }
public function setAttribute ( $ name , $ value ) { if ( ! isset ( $ value ) ) { unset ( $ this -> attributes [ $ name ] ) ; return $ this ; } $ this -> attributes [ $ name ] = ( string ) $ 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.

@param string      $name  The name of the attribute to set.
@param string|null $value The new attribute value.

@return $this This node instance, for call chaining.
Defines an attribute on this node . A value of null will unset the attribute . Note that the empty string is perfectly valid .