missingExtendsTemplate example

if ($stream->test(Token::STRING_TYPE)) {
            return [
                'scopes' => [TemplateScopeDetector::DEFAULT_SCOPE],
                'template' => $stream->next()->getValue(),
            ];
        }

        $expression = $this->parser->getExpressionParser()->parseExpression();
        $options = $this->convertExpressionToArray($expression);

        if (!isset($options['template']) || !\is_string($options['template'])) {
            throw AdapterException::missingExtendsTemplate($stream->getSourceContext()->getName());
        }

        if (!isset($options['scopes'])) {
            $options['scopes'] = [TemplateScopeDetector::DEFAULT_SCOPE];
        }

        if (\is_string($options['scopes'])) {
            $options['scopes'] = [$options['scopes']];
        }

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