Merge pull request #2239 from cscrewsandcaptains/develop

PHP 8.1 Support for addPreserveText
This commit is contained in:
Progi1984 2022-09-14 18:12:50 +02:00 committed by GitHub
commit 62584900b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -60,7 +60,7 @@ class PreserveText extends AbstractElement
$this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle); $this->paragraphStyle = $this->setNewStyle(new Paragraph(), $paragraphStyle);
$this->text = SharedText::toUTF8($text); $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])) { if (isset($matches[0])) {
$this->text = $matches; $this->text = $matches;
} }

View File

@ -171,6 +171,7 @@ class XMLWriter extends \XMLWriter
* @param mixed $value * @param mixed $value
* @return bool * @return bool
*/ */
#[\ReturnTypeWillChange]
public function writeAttribute($name, $value) public function writeAttribute($name, $value)
{ {
if (is_float($value)) { if (is_float($value)) {