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

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

public static createForEmptyFile ( ) : self
Результат self
    public static function createForEmptyFile() : self
    {
        return new static('An empty file name is not valid to be located.');
    }

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