Skip to content

Commit 7e89ad9

Browse files
authored
Merge pull request #4551 from oleibman/base2html
Minor Breaking Change - Move Some BaseWriter Properties
2 parents 20ac2f1 + 92b0a84 commit 7e89ad9

File tree

2 files changed

+22
-42
lines changed

2 files changed

+22
-42
lines changed

src/PhpSpreadsheet/Writer/BaseWriter.php

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace PhpOffice\PhpSpreadsheet\Writer;
44

5-
use PhpOffice\PhpSpreadsheet\Exception as PhpSpreadsheetException;
6-
75
abstract class BaseWriter implements IWriter
86
{
97
/**
@@ -19,18 +17,6 @@ abstract class BaseWriter implements IWriter
1917
*/
2018
protected bool $preCalculateFormulas = true;
2119

22-
/**
23-
* Table formats
24-
* Enables table formats in writer, disabled here, must be enabled in writer via a setter.
25-
*/
26-
protected bool $tableFormats = false;
27-
28-
/**
29-
* Conditional Formatting
30-
* Enables conditional formatting in writer, disabled here, must be enabled in writer via a setter.
31-
*/
32-
protected bool $conditionalFormatting = false;
33-
3420
/**
3521
* Use disk caching where possible?
3622
*/
@@ -72,34 +58,6 @@ public function setPreCalculateFormulas(bool $precalculateFormulas): self
7258
return $this;
7359
}
7460

75-
public function getTableFormats(): bool
76-
{
77-
return $this->tableFormats;
78-
}
79-
80-
public function setTableFormats(bool $tableFormats): self
81-
{
82-
if ($tableFormats) {
83-
throw new PhpSpreadsheetException('Table formatting not implemented for this writer');
84-
}
85-
86-
return $this;
87-
}
88-
89-
public function getConditionalFormatting(): bool
90-
{
91-
return $this->conditionalFormatting;
92-
}
93-
94-
public function setConditionalFormatting(bool $conditionalFormatting): self
95-
{
96-
if ($conditionalFormatting) {
97-
throw new PhpSpreadsheetException('Conditional Formatting not implemented for this writer');
98-
}
99-
100-
return $this;
101-
}
102-
10361
public function getUseDiskCaching(): bool
10462
{
10563
return $this->useDiskCaching;

src/PhpSpreadsheet/Writer/Html.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,18 @@ class Html extends BaseWriter
162162

163163
protected bool $ltrSheets = false;
164164

165+
/**
166+
* Table formats
167+
* Enables table formats in writer, disabled here, must be enabled in writer via a setter.
168+
*/
169+
protected bool $tableFormats = false;
170+
171+
/**
172+
* Conditional Formatting
173+
* Enables conditional formatting in writer, disabled here, must be enabled in writer via a setter.
174+
*/
175+
protected bool $conditionalFormatting = false;
176+
165177
/**
166178
* Create a new HTML.
167179
*/
@@ -1935,13 +1947,23 @@ public function setUseInlineCss(bool $useInlineCss): static
19351947
return $this;
19361948
}
19371949

1950+
public function getTableFormats(): bool
1951+
{
1952+
return $this->tableFormats;
1953+
}
1954+
19381955
public function setTableFormats(bool $tableFormats): self
19391956
{
19401957
$this->tableFormats = $tableFormats;
19411958

19421959
return $this;
19431960
}
19441961

1962+
public function getConditionalFormatting(): bool
1963+
{
1964+
return $this->conditionalFormatting;
1965+
}
1966+
19451967
public function setConditionalFormatting(bool $conditionalFormatting): self
19461968
{
19471969
$this->conditionalFormatting = $conditionalFormatting;

0 commit comments

Comments
 (0)