Skip to content

Commit c3dc7ae

Browse files
committed
PHP 8.1 compatibility bis
1 parent 9a18f94 commit c3dc7ae

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
strategy:
4848
fail-fast: false
4949
matrix:
50-
php: ['7.1', '7.2', '7.3', '7.4', '8.0'] #, '8.1'
50+
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
5151
steps:
5252
- name: Setup PHP
5353
uses: shivammathur/setup-php@v2

src/Common/XMLWriter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTempora
5959
if ($pTemporaryStorage == self::STORAGE_MEMORY) {
6060
$this->openMemory();
6161
} else {
62-
if (!is_dir($pTemporaryStorageDir)) {
62+
if ($pTemporaryStorageDir && !is_dir($pTemporaryStorageDir)) {
6363
$pTemporaryStorageDir = sys_get_temp_dir();
6464
}
6565
// Create temporary filename
@@ -178,12 +178,12 @@ public function writeAttributeIf(bool $condition, string $attribute, $value)
178178
*
179179
* @return bool
180180
*/
181-
public function writeAttribute($name, $value)
181+
public function writeAttribute($name, $value): bool
182182
{
183183
if (is_float($value)) {
184184
$value = json_encode($value);
185185
}
186186

187-
return parent::writeAttribute($name, $value);
187+
return parent::writeAttribute($name, $value ?? '');
188188
}
189189
}

0 commit comments

Comments
 (0)