/**
* @inheritdoc
*/
public function locate(string $name, string $currentPath = null) : string
{
if ('' == $name) {
throw FileNotFoundException::createForEmptyFile();
}
$file = $name;
if (false === $this->isAbsolutePath($name)) {
$file = null === $currentPath ? $name : $currentPath . DIRECTORY_SEPARATOR . $name;
}
if (false === ($path = realpath($file))) {
throw FileNotFoundException::createForNonExistentFile($file);
}
return $path;
}