Add ReaderOptions for all readers (#338)

Instead of passing every single option down the chain
This commit is contained in:
Adrien Loison authored and GitHub committed 2016-10-17 22:41:36 -07:00
1 parent b61323d7d2
commit 752f4bf64e
19 files changed
+332 -130

No files matched your search

+14 -1
View File
@@ -19,6 +19,19 @@ class Reader extends AbstractReader
/** @var SheetIterator To iterator over the ODS sheets */
protected $sheetIterator;
/**
* Returns the reader's current options
*
* @return ReaderOptions
*/
protected function getOptions()
{
if (!isset($this->options)) {
$this->options = new ReaderOptions();
}
return $this->options;
}
/**
* Returns whether stream wrappers are supported
*
@@ -42,7 +55,7 @@ class Reader extends AbstractReader
$this->zip = new \ZipArchive();
if ($this->zip->open($filePath) === true) {
$this->sheetIterator = new SheetIterator($filePath, $this->shouldFormatDates, $this->shouldPreserveEmptyRows);
$this->sheetIterator = new SheetIterator($filePath, $this->getOptions());
} else {
throw new IOException("Could not open $filePath for reading.");
}