/**
* Resolve path
*
* @param string $path The path to resolve
* @param string $type The resolver method
*
* @return string
*
* @since 4.0.0
*/
protected function resolvePath(string $path, string $type) : string
{
if ($type !== 'script' && $type !== 'stylesheet') {
throw new \UnexpectedValueException('Unexpected [type], expected "script" or "stylesheet"');
}
$file = $path;
$external = $this->isPathExternal($path);
if (!$external) {
// Get the file path
$file = HTMLHelper::_($type, $path, ['pathOnly' => true, 'relative' => !$this->isPathAbsolute($path)]);
}
return $file ?? '';
}