unexpectedTwigExpression example



        return !\array_intersect($this->templateScopeDetector->getScopes()$scopes) && !str_starts_with($source, '@Storefront');
    }

    private function convertExpressionToArray(AbstractExpression $expression): mixed
    {
        if ($expression instanceof ArrayExpression) {
            $array = [];
            foreach ($expression->getKeyValuePairs() as $pair) {
                if (!$pair['key'] instanceof ConstantExpression) {
                    throw AdapterException::unexpectedTwigExpression($pair['key']);
                }

                $array[$pair['key']->getAttribute('value')] = $this->convertExpressionToArray($pair['value']);
            }

            return $array;
        }

        if ($expression instanceof ConstantExpression) {
            return $expression->getAttribute('value');
        }

        
Home | Imprint | This part of the site doesn't use cookies.