Skip to content

Commit

Permalink
Whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Jul 26, 2023
1 parent 995f417 commit c2048ba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/documentinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -1525,11 +1525,14 @@ function metadata() {
/** @param string $key
* @param mixed $value */
function __set_metadata($key, $value) {
$m = $this->metadata() ?? (object) [];
$this->metadata();
if ($this->_metadata === null) {
$this->_metadata = (object) [];
}
if ($value !== null) {
$m->$key = $value;
$this->_metadata->$key = $value;
} else {
unset($m->$key);
unset($this->_metadata->$key);
}
}

Expand Down

0 comments on commit c2048ba

Please sign in to comment.