public function apply(Tag $tag, Renderer $renderer)
    {
        foreach ($this->stack as $item) {
            $result = $item['decorator']($tag, $renderer);
            // in case a decorator returns something unexpected
            if ($result instanceof Tag) {
                $tag = $result;
            } else {
                trigger_error(sprintf('%s does not return an instance of Sirius\\Html\\Tag',
                    get_class($item['decorator'])), E_USER_WARNING);
            }
        }

        return $tag;
    }