Skip to content

Commit

Permalink
Allow nullable theme for Xlsx Style Reader class (#1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Baker authored Jul 1, 2019
1 parent 0e6238c commit d645ed9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
3 changes: 3 additions & 0 deletions samples/Basic/16_Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
$spreadsheet = require __DIR__ . '/../templates/sampleSpreadsheet.php';

$helper->log('Write to CSV format');
/** @var \PhpOffice\PhpSpreadsheet\Writer\Csv $writer */
$writer = IOFactory::createWriter($spreadsheet, 'Csv')->setDelimiter(',')
->setEnclosure('"')
->setSheetIndex(0);
Expand All @@ -17,6 +18,7 @@

$helper->log('Read from CSV format');

/** @var \PhpOffice\PhpSpreadsheet\Reader\Csv $reader */
$reader = IOFactory::createReader('Csv')->setDelimiter(',')
->setEnclosure('"')
->setSheetIndex(0);
Expand All @@ -30,6 +32,7 @@

// Write CSV
$filenameCSV = $helper->getFilename(__FILE__, 'csv');
/** @var \PhpOffice\PhpSpreadsheet\Writer\Csv $writerCSV */
$writerCSV = IOFactory::createWriter($spreadsheetFromCSV, 'Csv');
$writerCSV->setExcelCompatibility(true);

Expand Down
1 change: 1 addition & 0 deletions samples/Basic/26_Utf8.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

// Export to CSV (.csv)
$helper->log('Write to CSV format');
/** @var \PhpOffice\PhpSpreadsheet\Writer\Csv $writer */
$writer = IOFactory::createWriter($spreadsheet, 'Csv');
$filename = $helper->getFilename(__FILE__, 'csv');
$callStartTime = microtime(true);
Expand Down
7 changes: 0 additions & 7 deletions src/PhpSpreadsheet/Reader/Security/XmlScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@

class XmlScanner
{
/**
* Identifies whether the thread-safe libxmlDisableEntityLoader() function is available.
*
* @var bool
*/
private $libxmlDisableEntityLoader = false;

/**
* String used to identify risky xml elements.
*
Expand Down
1 change: 0 additions & 1 deletion src/PhpSpreadsheet/Reader/Xlsx.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use PhpOffice\PhpSpreadsheet\Style\Protection;
use PhpOffice\PhpSpreadsheet\Style\Style;
use PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column;
use PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use SimpleXMLElement;
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Reader/Xlsx/Styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(\SimpleXMLElement $styleXml)
$this->styleXml = $styleXml;
}

public function setStyleBaseData(Theme $theme, $styles, $cellStyles)
public function setStyleBaseData(Theme $theme = null, $styles = [], $cellStyles = [])
{
self::$theme = $theme;
$this->styles = $styles;
Expand Down

0 comments on commit d645ed9

Please sign in to comment.