Nelmio\Alice\Throwable\Exception\FileLocator\FileNotFoundException::createForNonExistentFile PHP Метод

createForNonExistentFile() публичный статический Метод

public static createForNonExistentFile ( string $file ) : self
$file string
Результат self
    public static function createForNonExistentFile(string $file) : self
    {
        return new static(sprintf('The file "%s" does not exist.', $file));
    }

Usage 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;
 }