Skip to content

Commit

Permalink
PHP 8.1 compatibility bis
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Feb 17, 2022
1 parent 9a18f94 commit c3dc7ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0'] #, '8.1'
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
6 changes: 3 additions & 3 deletions src/Common/XMLWriter.php
Expand Up @@ -59,7 +59,7 @@ public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTempora
if ($pTemporaryStorage == self::STORAGE_MEMORY) {
$this->openMemory();
} else {
if (!is_dir($pTemporaryStorageDir)) {
if ($pTemporaryStorageDir && !is_dir($pTemporaryStorageDir)) {
$pTemporaryStorageDir = sys_get_temp_dir();
}
// Create temporary filename
Expand Down Expand Up @@ -178,12 +178,12 @@ public function writeAttributeIf(bool $condition, string $attribute, $value)
*
* @return bool
*/
public function writeAttribute($name, $value)
public function writeAttribute($name, $value): bool
{
if (is_float($value)) {
$value = json_encode($value);
}

return parent::writeAttribute($name, $value);
return parent::writeAttribute($name, $value ?? '');
}
}

0 comments on commit c3dc7ae

Please sign in to comment.