public function getResolveImportPathsCallback(array
$resolveMappings): \Closure
{ return function D
$originalPath) use ($resolveMappings) { foreach ($resolveMappings as $resolve =>
$resolvePath) { $resolve = '~' .
$resolve;
if (mb_strpos($originalPath,
$resolve) === 0
) { $dirname =
$resolvePath . \
dirname(mb_substr($originalPath,
mb_strlen($resolve)));
$filename =
basename($originalPath);
$extension =
$this->
getImportFileExtension(pathinfo($filename, \PATHINFO_EXTENSION
));
$path =
$dirname . \DIRECTORY_SEPARATOR .
$filename .
$extension;
if (file_exists($path)) { return $path;
} $path =
$dirname . \DIRECTORY_SEPARATOR . '_' .
$filename .
$extension;
if (file_exists($path)) { return $path;
} } }