Remove exception that can never happen

Because of type hinting in the constructor the spreadsheet object
can never be null anymore.
This commit is contained in:
Adrien Crivelli 2018-10-08 10:50:54 +11:00
parent edc608782f
commit 925205ed59
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
1 changed files with 0 additions and 25 deletions

View File

@ -344,11 +344,6 @@ class Html extends BaseWriter
*/
public function generateHTMLHeader($pIncludeStyles = false)
{
// Spreadsheet object known?
if ($this->spreadsheet === null) {
throw new WriterException('Internal Spreadsheet object not set to an instance of an object.');
}
// Construct HTML
$properties = $this->spreadsheet->getProperties();
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' . PHP_EOL;
@ -404,11 +399,6 @@ class Html extends BaseWriter
*/
public function generateSheetData()
{
// Spreadsheet object known?
if ($this->spreadsheet === null) {
throw new WriterException('Internal Spreadsheet object not set to an instance of an object.');
}
// Ensure that Spans have been calculated?
if ($this->sheetIndex !== null || !$this->spansAreCalculated) {
$this->calculateSpans();
@ -525,11 +515,6 @@ class Html extends BaseWriter
*/
public function generateNavigation()
{
// Spreadsheet object known?
if ($this->spreadsheet === null) {
throw new WriterException('Internal Spreadsheet object not set to an instance of an object.');
}
// Fetch sheets
$sheets = [];
if ($this->sheetIndex === null) {
@ -756,11 +741,6 @@ class Html extends BaseWriter
*/
public function generateStyles($generateSurroundingHTML = true)
{
// Spreadsheet object known?
if ($this->spreadsheet === null) {
throw new WriterException('Internal Spreadsheet object not set to an instance of an object.');
}
// Build CSS
$css = $this->buildCSS($generateSurroundingHTML);
@ -800,11 +780,6 @@ class Html extends BaseWriter
*/
public function buildCSS($generateSurroundingHTML = true)
{
// Spreadsheet object known?
if ($this->spreadsheet === null) {
throw new WriterException('Internal Spreadsheet object not set to an instance of an object.');
}
// Cached?
if ($this->cssStyles !== null) {
return $this->cssStyles;