fileNotFound() 공개 정적인 메소드

public static fileNotFound ( string $file ) : FileNotFoundException
$file string
리턴 FileNotFoundException
 /**
  *
  */
 public function testFileNotFound()
 {
     /** @var \BrowscapPHP\Exception\FileNotFoundException $exception */
     $exception = FileNotFoundException::fileNotFound('test.txt');
     self::assertInstanceOf('\\BrowscapPHP\\Exception\\FileNotFoundException', $exception);
     self::assertSame('File "test.txt" does not exist', $exception->getMessage());
 }
예제 #2
0
 /**
  * @param  string                                       $iniFile
  * @throws \BrowscapPHP\Exception\FileNotFoundException
  */
 public function convertFile($iniFile)
 {
     if (!$this->getFilesystem()->exists($iniFile)) {
         throw FileNotFoundException::fileNotFound($iniFile);
     }
     $this->logger->info('start reading file');
     $iniString = file_get_contents($iniFile);
     $this->logger->info('finished reading file');
     $this->convertString($iniString);
 }