Adds a tag to the list of self closing tags that should not have a trailing slash

@param $tag
@return Dom
@chainable
519805
public function addNoSlashTag($tag): Dom
    {
        if ( ! is_array($tag)) {
            $tag = [$tag];
        }
        foreach ($tag as $value) {
            $this->noSlash[] = $value;
        }

        return $this;
    }
407743
public function removeSelfClosingTag($tag): Dom
    {
        if ( ! is_array($tag)) {
            $tag = [$tag];
        }
        $this->selfClosing = array_diff($this->selfClosing, $tag);

        return $this;
    }
1015849
public function flush($tag) {
        $args = func_get_args();
        foreach ($args as $item) {
            if (in_array($item, $this->sequence)) {
                $this->$item = [];
            }
        }
        return $this;
    }
963161
public function withTag($tag) {
        if (is_null($this->tags)) {
            $this->tags = [];
        }

        array_push($this->tags, $tag);
        return $this;
    }
650173
protected function pushContext(Tag $tag)
	{
		$tagName   = $tag->getName();
		$tagFlags  = $tag->getFlags();
		$tagConfig = $this->tagsConfig[$tagName];

		++$this->cntTotal[$tagName];

		// If this is a self-closing tag, the context remains the same
		if ($tag->isSelfClosingTag())
		{
			return;
		}

		// Recompute the allowed tags
		$allowed = [];
		if ($tagFlags & self::RULE_IS_TRANSPARENT)
		{
			foreach ($this->context['allowed'] as $k => $v)
			{
				$allowed[] = $tagConfig['allowed'][$k] & $v;
			}
		}
		else
		{
			foreach ($this->context['allowed'] as $k => $v)
			{
				$allowed[] = $tagConfig['allowed'][$k] & (($v & 0xFF00) | ($v >> 8));
			}
		}

		// Use this tag's flags as a base for this context and add inherited rules
		$flags = $tagFlags | ($this->context['flags'] & self::RULES_INHERITANCE);

		// RULE_DISABLE_AUTO_BR turns off RULE_ENABLE_AUTO_BR
		if ($flags & self::RULE_DISABLE_AUTO_BR)
		{
			$flags &= ~self::RULE_ENABLE_AUTO_BR;
		}

		++$this->cntOpen[$tagName];
		$this->openTags[] = $tag;
		$this->context = [
			'allowed'       => $allowed,
			'flags'         => $flags,
			'inParagraph'   => false,
			'parentContext' => $this->context
		];
	}
1149040
public function addTag($tag)
    {
        if (!\in_array(ExtTagInterface::class, \class_implements($tag), true)) {
            throw new Exception(\sprintf('The class %s must be implement interface %s', $tag, ExtTagInterface::class));
        }

        $this->tags[] = $tag;
        return $this;
    }
70866
public function pairWith(Tag $tag)
	{
		if ($this->name === $tag->name)
		{
			if ($this->type === self::START_TAG
			 && $tag->type  === self::END_TAG
			 && $tag->pos   >=  $this->pos)
			{
				$this->endTag  = $tag;
				$tag->startTag = $this;

				$this->cascadeInvalidationTo($tag);
			}
			elseif ($this->type === self::END_TAG
			     && $tag->type  === self::START_TAG
			     && $tag->pos   <=  $this->pos)
			{
				$this->startTag = $tag;
				$tag->endTag    = $this;
			}
		}
	}
454251
public function detachTag(Tag $tag)
    {
        if (!$this->hasTag($tag)) {
            throw new OutOfBoundsException('Tag '.$tag->getName().' is not attached');
        }

        $this->_tags = array_filter($this->_tags, function ($knownTag) use ($tag) {
            return $tag->getId() != $knownTag->getId();
        });

        return $this;
    }
788452
public function getTagCommit(Tag $tag)
    {
        $this->clearAll();
        $this->addCommandName(static::GIT_REVLIST);
        // only the last commit
        $this->addCommandArgument('-n1');
        $this->addCommandSubject($tag->getFullRef());

        return $this->getCommand();
    }
389023
public function tag($tag, array $keys)
	{
		foreach ($keys as $key)
		{
			$resolvedKey = $this->resolveAlias($key);

			if (!isset($this->tags[$tag]))
			{
				$this->tags[$tag] = array();
			}

			$this->tags[$tag][] = $resolvedKey;
		}

		// Prune duplicates
		$this->tags[$tag] = array_unique($this->tags[$tag]);

		return $this;
	}
711498
public function tag($tag)
    {
        $this->sys->exec(sprintf('git tag %s', $tag), 'Unable to create tag');
        $this->sys->exec('git push --tags', 'Unable to push tags');

        return $this;
    }
1327875
public function remove($tag)
    {
        if ($this->count() == 0) {
            return [$this, null];
        }

        $deleted = null;

        foreach ($this->items as $key => $element) {
            if ($element === $tag) {
                $this->forget($key);

                $deleted = $tag;

                break;
            }
        }

        return [$this, $deleted];
    }
4483
public function tag($tag, $attr = null, $content = null, $close = false)
    {
        $tag = strtolower($tag);

        if (! empty($attr) && is_array($attr)) {
            $attr = $this->Attr->attr($attr);
        }

        if ($close) {
            return sprintf('<%s%s>%s</%1$s>', $tag, $attr, $content);
        } else {
            return sprintf('<%s%s>', $tag, $attr);
        }
    }
682367
public function end_tag($tag) {
        // TODO: check the tag name is valid

        if ($this->level == 0) { // Nothing to end, already at level 0
            throw new xml_writer_exception('xml_writer_end_tag_no_match');
        }

        $pre = $this->lastwastext ? '' : "\n" . str_repeat(' ', ($this->level - 1) * 2); // Indent
        $tag = $this->casefolding ? strtoupper($tag) : $tag; // Follow casefolding

        $lastopentag = array_pop($this->opentags);

        if ($tag != $lastopentag) {
            $a = new stdclass();
            $a->lastopen = $lastopentag;
            $a->tag = $tag;
            throw new xml_writer_exception('xml_writer_end_tag_no_match', $a);
        }

        // Send to xml_output
        $this->write($pre . '</' . $tag . '>');

        $this->level--;
        $this->lastwastext = false;
    }
45581
public function attachTags($tags)
    {
        // Use 'sync' not 'attach' to avoid Integrity constraint violation
        $this->tags()->sync($this->parseTags($tags), false);

        return $this;
    }
756274
public function setTags($tags)
    {
        $this->tags = [];
        $this->ref = null;

        if (is_array($tags)) {
            foreach ($tags as $tag) {
                $this->addTag($tag);
            }
        } else {
            $this->addTag($tags);
        }

        return $this;
    }
1005604
public function add_tag( $tag = '', $regex = '', $force = false ) {
		if ( ! isset( $this->rewrite_tag[ $tag ] ) || isset( $this->rewrite_tag[ $tag ] ) && true === $force ) {
			$this->rewrite_tag[ $tag ] = $regex;
		}
		return $this;
	}