Noherczeg\Breadcrumb\Translator::loadFile PHP Метод

loadFile() публичный Метод

loadFile: yeah, well, separated due to testing purposes :(
public loadFile ( String $file_to_load = null ) : array
$file_to_load String Language file's name
Результат array
    public function loadFile($file_to_load = null)
    {
        if (!file_exists($file_to_load)) {
            throw new \Noherczeg\Breadcrumb\FileNotFoundException("Can not load the requested language file: {$file_to_load}!");
        } else {
            return require $file_to_load;
        }
    }

Usage Example

Пример #1
0
 /**
  * Test provide file not found thrown as exception
  *
  * @expectedException \Noherczeg\Breadcrumb\FileNotFoundException
  */
 public function testFileNotFoundException()
 {
     $this->tran->loadFile(2);
     $this->tran->loadFile();
     $this->tran->loadFile(true);
     $this->tran->loadFile('asd');
 }