Nette\Utils\FileSystem::read PHP Метод

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

Reads file content.
public static read ( $file ) : string
Результат string
    public static function read($file)
    {
        $content = @file_get_contents($file);
        // @ is escalated to exception
        if ($content === FALSE) {
            throw new Nette\IOException("Unable to read file '{$file}'.");
        }
        return $content;
    }

Usage Example

 public function parseFromFilePath(string $filePath) : array
 {
     $fileContent = FileSystem::read($filePath);
     $eolChar = $this->eolCharDetector->detectForContent($fileContent);
     return $this->parseLegacyWithFileContentAndEolChar($fileContent, $eolChar);
 }
All Usage Examples Of Nette\Utils\FileSystem::read