Inheritance: extends UnexpectedValueException
Example #1
0
 /**
  * @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;
 }