Drop $this->spreadSheet null check from Xlsx Writer (#1646)
$this->spreadSheet cannot be null
This commit is contained in:
parent
416e27b632
commit
3d9867ce95
|
@ -178,7 +178,6 @@ class Xlsx extends BaseWriter
|
||||||
*/
|
*/
|
||||||
public function save($pFilename): void
|
public function save($pFilename): void
|
||||||
{
|
{
|
||||||
if ($this->spreadSheet !== null) {
|
|
||||||
// garbage collect
|
// garbage collect
|
||||||
$this->pathNames = [];
|
$this->pathNames = [];
|
||||||
$this->spreadSheet->garbageCollect();
|
$this->spreadSheet->garbageCollect();
|
||||||
|
@ -407,9 +406,6 @@ class Xlsx extends BaseWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->maybeCloseFileHandle();
|
$this->maybeCloseFileHandle();
|
||||||
} else {
|
|
||||||
throw new WriterException('PhpSpreadsheet object unassigned.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -419,13 +415,9 @@ class Xlsx extends BaseWriter
|
||||||
*/
|
*/
|
||||||
public function getSpreadsheet()
|
public function getSpreadsheet()
|
||||||
{
|
{
|
||||||
if ($this->spreadSheet !== null) {
|
|
||||||
return $this->spreadSheet;
|
return $this->spreadSheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new WriterException('No Spreadsheet object assigned.');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Spreadsheet object.
|
* Set Spreadsheet object.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue