Skip to content

Commit

Permalink
Merge pull request #2239 from cscrewsandcaptains/develop
Browse files Browse the repository at this point in the history
PHP 8.1 Support for addPreserveText
  • Loading branch information
Progi1984 committed Sep 14, 2022
2 parents a006aa8 + 91416e4 commit 6258490
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpWord/Element/PreserveText.php
Expand Up @@ -60,7 +60,7 @@ public function __construct($text = null, $fontStyle = null, $paragraphStyle = n
$this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle);

$this->text = SharedText::toUTF8($text);
$matches = preg_split('/({.*?})/', $this->text, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$matches = preg_split('/({.*?})/', $this->text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
if (isset($matches[0])) {
$this->text = $matches;
}
Expand Down
1 change: 1 addition & 0 deletions src/PhpWord/Shared/XMLWriter.php
Expand Up @@ -171,6 +171,7 @@ public function writeAttributeIf($condition, $attribute, $value)
* @param mixed $value
* @return bool
*/
#[\ReturnTypeWillChange]
public function writeAttribute($name, $value)
{
if (is_float($value)) {
Expand Down

0 comments on commit 6258490

Please sign in to comment.