Context/ContextualOptionResolver.php
public function contextualizeOption($value, array $context)
    {
        // Recursively parse options
        if (\is_array($value)) {
            return $this->contextualizeOptions($value, $context);
        }

        if (\is_string($value)) {
            $pattern = sprintf('/{{[ ]*(%s){1}[ ]*}}/', implode('|', array_keys($context)));

            $matches = [];
            $result = preg_match($pattern, $value, $matches);

            // If it's an exact match, directly returns the value (allowing complex values such as an array)
            if ($result && $matches[0] === $value) {
                return $context[$matches[1]];
            }

            // Else use a replace to insert a string value into another
            return preg_replace_callback(
                $pattern,
                function ($matches) use ($context) {
                    return $context[$matches[1]];
                },
                $value
            );
        }

        return $value;
    }
public function contextualizeOption($value, array $context)
    {
        // Recursively parse options
        if (\is_array($value)) {
            return $this->contextualizeOptions($value, $context);
        }

        if (\is_string($value)) {
            $pattern = sprintf('/{{[ ]*(%s){1}[ ]*}}/', implode('|', array_keys($context)));

            $matches = [];
            $result = preg_match($pattern, $value, $matches);

            // If it's an exact match, directly returns the value (allowing complex values such as an array)
            if ($result && $matches[0] === $value) {
                return $context[$matches[1]];
            }

            // Else use a replace to insert a string value into another
            return preg_replace_callback(
                $pattern,
                function ($matches) use ($context) {
                    return $context[$matches[1]];
                },
                $value
            );
        }

        return $value;
    }
Basic value inference
Replaces "{{ key }}" by context[key]

@param string|array $value
@param array        $context

@return mixed