Sulu\Bundle\MarkupBundle\Markup\HtmlMarkupParser::getTags PHP Method

getTags() private method

Returns found tags and their attributes.
private getTags ( string $content ) : array
$content string
return array
    private function getTags($content)
    {
        if (!preg_match_all(sprintf(self::TAG_REGEX, $this->namespace, $this->namespace), $content, $matches)) {
            return [];
        }
        $sortedTags = [];
        for ($i = 0, $length = count($matches['name']); $i < $length; ++$i) {
            $tag = $matches['tag'][$i];
            $name = $matches['name'][$i];
            if (!array_key_exists($name, $sortedTags)) {
                $sortedTags[$name] = [];
            }
            $sortedTags[$name][$tag] = $this->getAttributes($tag);
        }
        return $sortedTags;
    }