protected function loadFile($filename)
    {
        if (!is_string($filename)) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 1 to be string, %s given', __METHOD__, gettype($filename)));
        }

        try {
            $content = file_get_contents($filename);
        } catch (\Exception $exception) {
            throw new RuntimeException(sprintf('Could not load file %s', $filename));
        }

        if ($content === false) {
            throw new RuntimeException(sprintf('Could not load file %s', $filename));
        }

        return $content;
    }
protected function loadFile($filename)
    {
        if (!is_string($filename)) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 1 to be string, %s given', __METHOD__, gettype($filename)));
        }

        try {
            $content = file_get_contents($filename);
        } catch (\Exception $exception) {
            throw new RuntimeException(sprintf('Could not load file %s', $filename));
        }

        if ($content === false) {
            throw new RuntimeException(sprintf('Could not load file %s', $filename));
        }

        return $content;
    }
protected function loadFile ( $ filename ) { if ( ! is_string ( $ filename ) ) { throw new InvalidArgumentException ( sprintf ( '%s expects parameter 1 to be string, %s given' , __METHOD__ , gettype ( $ filename ) ) ) ; } try { $ content = file_get_contents ( $ filename ) ; } catch ( \ Exception $ exception ) { throw new RuntimeException ( sprintf ( 'Could not load file %s' , $ filename ) ) ; } if ( $ content === false ) { throw new RuntimeException ( sprintf ( 'Could not load file %s' , $ filename ) ) ; } return $ content ; }
Reads entire file into a string.

@param string $filename The path to the file

@return string

@throws \InvalidArgumentException if the file path is not a string
@throws \RuntimeException if an error occurred
Reads entire file into a string .