WordPress at a glance
function is not described

Composer\Installers

BaseInstaller::templatePath() protected WC 1.0

Replace vars in a path

{} It's a method of the class: BaseInstaller{}

No Hooks.

Return

String. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->templatePath( $path, $vars );
$path(string) (required)
-
$vars(array)
-
Default: array()

Code of BaseInstaller::templatePath() WC 5.3.0

<?php
protected function templatePath($path, array $vars = array())
{
    if (strpos($path, '{') !== false) {
        extract($vars);
        preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
        if (!empty($matches[1])) {
            foreach ($matches[1] as $var) {
                $path = str_replace('{$' . $var . '}', $$var, $path);
            }
        }
    }

    return $path;
}