private function createComplexSettingExpression($argumentValue, array $dynamicSettings)
    {
        $resolverArguments = ['"' . $argumentValue . '"'];
        foreach ($dynamicSettings as $dynamicSetting) {
            // Trim the '$'  so that the dynamic setting doesn't get transformed
            $resolverArguments[] = '"' . trim($dynamicSetting, '$') . '"';
            // This one will be transformed
            $resolverArguments[] = $this->createConfigResolverSubExpression(
                $this->parser->parseDynamicSetting($dynamicSetting)
            );
        }

        $expression = sprintf(
            'service("ezpublish.config.complex_setting_value.resolver").resolveSetting(%s)',
            implode(', ', $resolverArguments)
        );

        return new Expression($expression);
    }
private function createComplexSettingExpression($argumentValue, array $dynamicSettings)
    {
        $resolverArguments = ['"' . $argumentValue . '"'];
        foreach ($dynamicSettings as $dynamicSetting) {
            // Trim the '$'  so that the dynamic setting doesn't get transformed
            $resolverArguments[] = '"' . trim($dynamicSetting, '$') . '"';
            // This one will be transformed
            $resolverArguments[] = $this->createConfigResolverSubExpression(
                $this->parser->parseDynamicSetting($dynamicSetting)
            );
        }

        $expression = sprintf(
            'service("ezpublish.config.complex_setting_value.resolver").resolveSetting(%s)',
            implode(', ', $resolverArguments)
        );

        return new Expression($expression);
    }
private function createComplexSettingExpression ( $ argumentValue , array $ dynamicSettings ) { $ resolverArguments = [ '"' . $ argumentValue . '"' ] ; foreach ( $ dynamicSettings as $ dynamicSetting ) { // Trim the '$'  so that the dynamic setting doesn't get transformed $ resolverArguments [ ] = '"' . trim ( $ dynamicSetting , '$' ) . '"' ; // This one will be transformed $ resolverArguments [ ] = $ this -> createConfigResolverSubExpression ( $ this -> parser -> parseDynamicSetting ( $ dynamicSetting ) ) ; } $ expression = sprintf ( 'service("ezpublish.config.complex_setting_value.resolver").resolveSetting(%s)' , implode ( ', ' , $ resolverArguments ) ) ; return new Expression ( $ expression ) ; }
Creates an expression for given complex setting.

The expression uses 'ezpublish.config.complex_setting_value.resolver' service for complex setting resolution.
The complex setting value resolver has a variable number of arguments.
Dynamic settings are added as tuples: first the argument without the leading and trailing $, so that it is not
transformed by the config resolver pass, then the argument as a string, so that it does get transformed.

@param string $argumentValue The original argument ($var$/$another_var$)
@param array $dynamicSettings Array of dynamic settings in $argumentValue

@return Expression
Creates an expression for given complex setting .