Skip to content

Commit 6258490

Browse files
authored
Merge pull request #2239 from cscrewsandcaptains/develop
PHP 8.1 Support for addPreserveText
2 parents a006aa8 + 91416e4 commit 6258490

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/PhpWord/Element/PreserveText.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct($text = null, $fontStyle = null, $paragraphStyle = n
6060
$this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle);
6161

6262
$this->text = SharedText::toUTF8($text);
63-
$matches = preg_split('/({.*?})/', $this->text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
63+
$matches = preg_split('/({.*?})/', $this->text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
6464
if (isset($matches[0])) {
6565
$this->text = $matches;
6666
}

src/PhpWord/Shared/XMLWriter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public function writeAttributeIf($condition, $attribute, $value)
171171
* @param mixed $value
172172
* @return bool
173173
*/
174+
#[\ReturnTypeWillChange]
174175
public function writeAttribute($name, $value)
175176
{
176177
if (is_float($value)) {

0 commit comments

Comments
 (0)