StackFormation\PrefixedTemplate::updateRef PHP Method

updateRef() protected method

protected updateRef ( $prefix, $template ) : mixed
$prefix
$template
return mixed
    protected function updateRef($prefix, $template)
    {
        // Update all { "Ref": "..." }
        $template = preg_replace_callback('/\\{\\s*"Ref"\\s*:\\s*"([a-zA-Z0-9:]+?)"\\s*\\}/', function ($matches) use($prefix) {
            if (true === in_array($matches[1], $this->pseudoParameters)) {
                return '{"Ref":"' . $matches[1] . '"}';
            }
            return '{"Ref":"' . $prefix . $matches[1] . '"}';
        }, $template);
        return $template;
    }