Add attribute by name.

@param string $name
@param mixed  $value

@return \HnhDigital\NavigationBuilder\Item
185962
public function addAttribute($name, ...$value)
    {
        $value = is_array(array_get($value, 0, '')) ? array_get($value, 0) : $value;
        list($current_value, $separator) = $this->manipulateAttribute($name, $value);

        foreach ($value as $attribute_value) {
            $current_value[] = $attribute_value;
        }

        $this->updateAttribute($name, $current_value, $separator);

        return $this;
    }
978089
public function add(string $name, array $value)
    {
        $this->config->add($name, $value);
        return $this;
    }
87665
public static function addAttribute(\DOMNode $rootNode, $name, $value)
    {
        XmlUtil::checkIfPrefixWasDefined($rootNode, $name);

        $owner = XmlUtil::getOwnerDocument($rootNode);
        $attrNode = $owner->createAttribute($name);
        $attrNode->value = $value;
        $rootNode->setAttributeNode($attrNode);
        return $rootNode;
    }
148974
public function append($name, $value)
  {
    $v = $this->get($name);

    if (is_array($v)) {
      array_push($v, $value);

      return $this->set($name, $v);
    }

    return $this->set($name, $v . $value);
  }
317393
public function setAttribute(string $name, string $value) : Tag
    {
        $this->attributes[strtolower($name)] = $value;

        return $this;
    }
941214
public function addAttribute($name = null, $value)
    {
        if ($value) {
            $this->attributes[$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;
    }
758313
public function appendAttr(string $name, string $value, string $separator = ';')
    {

        if (isset($this->attr[$name])) {
            $this->attr[$name] .= ($separator . $value);
        } else {
            $this->attr[$name] = $value;
        }

        return $this;
    }
883564
final protected function setAttribute($name, $value)
    {
        if ($value !== null && $this->hasAttributeValueFactory($name)) {
            $this->internalCache[$name] = $this->createAttributeValue($name, $value);

            if ($this->internalCache[$name] instanceof JsonSerializable) {
                $value = $this->internalCache[$name]->jsonSerialize();
            } elseif (is_array($this->internalCache[$name])) {
                $value = array_map(
                    function ($value) {
                        if ($value instanceof JsonSerializable) {
                            $value = $value->jsonSerialize();
                        }

                        return $value;
                    },
                    $this->internalCache[$name]
                );
            } else {
                $value = $this->internalCache[$name];
            }
        }

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

        return $this;
    }
832806
private function updateAttribute($name, $value)
    {
        $attribute = $this->getAttr($name);

        if (! is_null($attribute)) {
            $attribute->addContent($value);

            $this->put($name, $attribute);
        }

        return $this;
    }
560981
public function setAttribute($name, $value)
    {
        if ('q' === $name) {
            $this->quality = (float) $value;
        } else {
            $this->attributes[$name] = (string) $value;
        }

        return $this;
    }
1256152
public function setAttribute($name, $value)
    {
        foreach ($this as $node) {
            if ($node instanceof \DOMElement) {
                /** @var \DOMElement $node */
                $node->setAttribute($name, $value);
            }
        }
        return $this;
    }
284210
public function setAttribute(string $name, string $value) : Label
    {
        $this->tag->setAttribute($name, $value);

        return $this;
    }
52998
public function addAttribute($name, $value) {
        $this->setVariable(self::ATTRIBUTES, $this->addValue($this->getVariable(self::ATTRIBUTES), $this->assembleAssignmentString($name, $value)));
    }
694587
public function setAttribute($name, $value = null)
	{
		if (is_null($value))
		{
			if ( ! is_array($name))
			{
				throw new InvalidArgumentException('If the value is null then name must be an array');
			}

			return $this->setAttributes($name);
		}

		Arr::set($this->attributes, $name, $value);

		return $this;
	}
1300851
public function setAttribute($name, $value)
    {
        if(strlen($name) < 1)
        {
            throw new HTMLTagException("Attribute name is empty");
        }

        $this->tag_attributes[strtolower($name)] = $value;

        return $this;
    }
758369
public function setAttribute($name, ...$value)
    {
        $value = is_array(array_get($value, 0, '')) ? array_get($value, 0) : $value;
        $this->updateAttribute($name, $value, $this->getAttributeValueSeparator($name));

        return $this;
    }