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
|
||||
{
|
||||
if ($this->spreadSheet !== null) {
|
||||
// garbage collect
|
||||
$this->pathNames = [];
|
||||
$this->spreadSheet->garbageCollect();
|
||||
|
@ -407,9 +406,6 @@ class Xlsx extends BaseWriter
|
|||
}
|
||||
|
||||
$this->maybeCloseFileHandle();
|
||||
} else {
|
||||
throw new WriterException('PhpSpreadsheet object unassigned.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -419,13 +415,9 @@ class Xlsx extends BaseWriter
|
|||
*/
|
||||
public function getSpreadsheet()
|
||||
{
|
||||
if ($this->spreadSheet !== null) {
|
||||
return $this->spreadSheet;
|
||||
}
|
||||
|
||||
throw new WriterException('No Spreadsheet object assigned.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Spreadsheet object.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue