forInvalidDecorator example


    /** * Runs the generated output through any declared * view decorators. */
    protected function decorateOutput(string $html): string
    {
        $decorators = \config(ViewConfig::class)->decorators;

        foreach ($decorators as $decorator) {
            if (is_subclass_of($decorator, ViewDecoratorInterface::class)) {
                throw ViewException::forInvalidDecorator($decorator);
            }

            $html = $decorator::decorate($html);
        }

        return $html;
    }
}
Home | Imprint | This part of the site doesn't use cookies.