src/Utility/File.php
public static function readLines($path, $skipEmpty = false)
    {
        if (!is_file($path) || !is_readable($path)) {
            throw new RuntimeException("File '$path' doesn't exist or is not a readable file");
        }


        $lines = ($skipEmpty)
            ? file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
            : file($path, FILE_IGNORE_NEW_LINES);

        if ($lines === false) {
            throw new RuntimeException("Something went wrong while reading '$path' file content");
        }

        return $lines;
    }
public static function readLines($path, $skipEmpty = false)
    {
        if (!is_file($path) || !is_readable($path)) {
            throw new RuntimeException("File '$path' doesn't exist or is not a readable file");
        }


        $lines = ($skipEmpty)
            ? file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)
            : file($path, FILE_IGNORE_NEW_LINES);

        if ($lines === false) {
            throw new RuntimeException("Something went wrong while reading '$path' file content");
        }

        return $lines;
    }
public static function readLines ( $ path , $ skipEmpty = false ) { if ( ! is_file ( $ path ) || ! is_readable ( $ path ) ) { throw new RuntimeException ( "File '$path' doesn't exist or is not a readable file" ) ; } $ lines = ( $ skipEmpty ) ? file ( $ path , FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES ) : file ( $ path , FILE_IGNORE_NEW_LINES ) ; if ( $ lines === false ) { throw new RuntimeException ( "Something went wrong while reading '$path' file content" ) ; } return $ lines ; }
Read file content into array of lines without trailing newlines

@param string $path Path to file
@param bool $skipEmpty Flag to skip empty lines

@return array Lines of file content
Read file content into array of lines without trailing newlines