Add new var class to element

@param $name
@param $value
@return $this
518074
public function addVarAttr($name, $value)
    {
        if (!in_array($name, $this->varAttr)) {
            $this->varAttr[$name] = $value;
        }
        return $this;
    }
637020
public function setAttr(string $name, string $value)
    {
        $this->attr[$name] = $value;

        return $this;
    }
174465
public function addAttribute($name, $value)
    {
        if ($name === 'class') {
            $this->addAttributeClass($value);
        } elseif ($name === 'style') {
            $value = rtrim($value, ';') . ';';
            $value = explode(';', $value);
            $value = array_filter($value);

            foreach ($value as $style) {
                if (preg_match_all("/(.*)(: )(.*)/", $style, $match)) {
                    $this->addAttributeStyle($match[ 1 ][ 0 ], $match[ 3 ][ 0 ]);
                } elseif (preg_match_all("/(.*)(:)(.*)/", $style, $match)) {
                    $this->addAttributeStyle($match[ 1 ][ 0 ], $match[ 3 ][ 0 ]);
                }
            }
        } elseif (is_string($value)) {
            $this->storage[ $name ] = trim($value);
        } else {
            $this->storage[ $name ] = $value;
        }

        return $this;
    }
330340
final public function withAddedHeader($name, $value): self
    {
        return $this->withHeader($name, array_merge($this->getHeader($name), (array)$value));
    }
286511
public function addAttr($name, $value)
    {
        if (!in_array($name, $this->attributes)) {
            $this->attributes[$name] = $value;
        }
        return $this;
    }
1093011
public function withAddedHeader($name, $value)
    {
        $instance = clone $this;
        $instance->headers->add($name, $value);
        return $instance;
    }
1106576
public function add($name, $value)
    {
        if ($this->has($name)) {
            $this->updateAttribute($name, $value);
        }
        else {
            $this->makeAttribute($name, $value);
        }

        return $this;
    }
793908
public function addParam($name, $value): self
    {
        if (!isset($this->params[$name])) {
            $this->setParam($name, $value);
        }

        return $this;
    }
199832
public function setAttr(string $name, $value): self {
        $this->collection()->each(function($node) use($name, $value) {
            if ($node instanceof \DOMElement) {
                $node->setAttribute($name, (string)$value);
            }
        });

        return $this;
    }
1118636
public function set($name, $value = null)
    {
        if ($name === 'value') {
            $value = htmlspecialchars($value);
        }
        parent::set($name, $value);

        return $this;
    }
682749
public function placeholder(string $name, string $value): self
    {
        $this->data->placeholder($name, $value);
        return $this;
    }
279175
public function withAddedParameter($name, $value)
    {
        $new = clone $this;
        $new->parameters[$name] = $new->hasParameter($name)
            ? array_merge((array) $new->parameters[$name], (array) $value)
            : $value;

        return $new;
    }
1314324
public function add(string $name, string $value): HeaderCollection
    {
        $name = trim(strtolower($name));
        if (!array_key_exists($name, $this->headers)) {
            $this->headers[$name] = new Header($name);
        }
        $this->headers[$name]->addValue($value);
        return $this;
    }
141641
public function addVarnishHeader($name, $value)
    {
        $header = $value;
        
        if ($this->hasVarnishHeader($name)) {
            $header = $this->getVarnishHeader($name);
            
            if (!is_array($header)) {
                $header = array($header);
            }
            
            $header[] = $value;
        } 
        
        $this->setVarnishHeader($name, $header);
        
        return $this;
    }
476625
function add($name, $value) {
		if (isset($this->metadata[$name]) && ! is_array($this->metadata[$name])) {
			$this->metadata[$name] = [ $this->metadata[$name] ];
		}

		$this->metadata[$name][] = $value;

		return $this;
	}
419228
public function addSetting($name, $value) {
        $setting = new Setting();
        $setting->setName($name)
                ->setValue($value);
        $this->builder->addDirective($setting);
        return $this;
    }
2282
public function addToAttribute($name, $value)
    {
        $attr = $this->getAttribute($name);
        $this->setAttribute($name, $attr . $value);

        return $this;
    }