/** * This constructor instantiates the class. * * @access public * @param IO\File $file the file to be opened * @throws Throwable\FileNotFound\Exception indicates the file could not be * opened * @throws Throwable\InvalidArgument\Exception indicates the file is not readable */ public function __construct(IO\File $file) { if (!$file->exists()) { throw new Throwable\FileNotFound\Exception('Unable to open file :file.', array(':file' => $file)); } if (!$file->isReadable()) { throw new Throwable\InvalidArgument\Exception('Unable to read from file. File ":file" is not readable.', array(':file' => $file)); } $this->file = $file; $this->handle = null; $this->open(); }