public static function expand($template, array $variables)
    {
        if (strpos($template, '{') === false) {
            return $template;
        }

        self::$variables = $variables;

        return preg_replace_callback('/\{([^\}]+)\}/', [UriTemplate::class, 'expandMatch'], $template);
    }
public static function expand($template, array $variables)
    {
        if (strpos($template, '{') === false) {
            return $template;
        }

        self::$variables = $variables;

        return preg_replace_callback('/\{([^\}]+)\}/', [UriTemplate::class, 'expandMatch'], $template);
    }
public static function expand ( $ template , array $ variables ) { if ( strpos ( $ template , '{' ) === false ) { return $ template ; } self :: $ variables = $ variables ; return preg_replace_callback ( '/\{([^\}]+)\}/' , [ UriTemplate :: class , 'expandMatch' ] , $ template ) ; }
Expand the template string using the supplied variables

@param string $template URI template to expand
@param array $variables variables to use with the expansion
@return string
Expand the template string using the supplied variables