src/Translate.php
protected function addResourceFile(string $file): void
    {
        if (!is_file($file)) {
            throw new \InvalidArgumentException("$file is not a file");
        }
        
        $contents = file_get_contents($file);
        
        if ($contents === false) {
            throw new \RuntimeException("Error reading file at $file.");
        }
        
        $this->addResourceString($contents);
    }
protected function addResourceFile(string $file): void
    {
        if (!is_file($file)) {
            throw new \InvalidArgumentException("$file is not a file");
        }
        
        $contents = file_get_contents($file);
        
        if ($contents === false) {
            throw new \RuntimeException("Error reading file at $file.");
        }
        
        $this->addResourceString($contents);
    }
protected function addResourceFile ( string $ file ) : void { if ( ! is_file ( $ file ) ) { throw new \ InvalidArgumentException ( "$file is not a file" ) ; } $ contents = file_get_contents ( $ file ) ; if ( $ contents === false ) { throw new \ RuntimeException ( "Error reading file at $file." ) ; } $ this -> addResourceString ( $ contents ) ; }
Adds a resource file
@param string $file The path to the resource file
@throws \InvalidArgumentException If the filename provided is not a file
@throws \RuntimeException If the file could not be read
Adds a resource file