private static function open(TagInterface $tag, $autoClosed = false)
    {
        $output =  '<' . $tag->getType();

        if ($tag->hasAttributes()) {
            $output .= ' ' . $tag->renderAttributes();
        }

        $output .= ($autoClosed ? '/>' : '>');

        return $output;
    }