Merge pull request #4551 from oleibman/base2html

Minor Breaking Change - Move Some BaseWriter Properties
This commit is contained in:
oleibman
2025-08-03 01:49:48 +00:00
committed by GitHub
2 changed files with 22 additions and 42 deletions
-42
View File
@@ -2,8 +2,6 @@
namespace PhpOffice\PhpSpreadsheet\Writer;
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;
abstract class BaseWriter implements IWriter
{
/**
@@ -19,18 +17,6 @@ abstract class BaseWriter implements IWriter
*/
protected bool $preCalculateFormulas = true;
/**
* Table formats
* Enables table formats in writer, disabled here, must be enabled in writer via a setter.
*/
protected bool $tableFormats = false;
/**
* Conditional Formatting
* Enables conditional formatting in writer, disabled here, must be enabled in writer via a setter.
*/
protected bool $conditionalFormatting = false;
/**
* Use disk caching where possible?
*/
@@ -72,34 +58,6 @@ abstract class BaseWriter implements IWriter
return $this;
}
public function getTableFormats(): bool
{
return $this->tableFormats;
}
public function setTableFormats(bool $tableFormats): self
{
if ($tableFormats) {
throw new PhpSpreadsheetException('Table formatting not implemented for this writer');
}
return $this;
}
public function getConditionalFormatting(): bool
{
return $this->conditionalFormatting;
}
public function setConditionalFormatting(bool $conditionalFormatting): self
{
if ($conditionalFormatting) {
throw new PhpSpreadsheetException('Conditional Formatting not implemented for this writer');
}
return $this;
}
public function getUseDiskCaching(): bool
{
return $this->useDiskCaching;
+22
View File
@@ -162,6 +162,18 @@ class Html extends BaseWriter
protected bool $ltrSheets = false;
/**
* Table formats
* Enables table formats in writer, disabled here, must be enabled in writer via a setter.
*/
protected bool $tableFormats = false;
/**
* Conditional Formatting
* Enables conditional formatting in writer, disabled here, must be enabled in writer via a setter.
*/
protected bool $conditionalFormatting = false;
/**
* Create a new HTML.
*/
@@ -1935,6 +1947,11 @@ class Html extends BaseWriter
return $this;
}
public function getTableFormats(): bool
{
return $this->tableFormats;
}
public function setTableFormats(bool $tableFormats): self
{
$this->tableFormats = $tableFormats;
@@ -1942,6 +1959,11 @@ class Html extends BaseWriter
return $this;
}
public function getConditionalFormatting(): bool
{
return $this->conditionalFormatting;
}
public function setConditionalFormatting(bool $conditionalFormatting): self
{
$this->conditionalFormatting = $conditionalFormatting;