Skip to content

Commit

Permalink
use isset instead of empty to handle 0 root
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Aug 3, 2024
1 parent 60976bb commit 6a30f0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Model/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public static function from(mixed $document): self
if (is_array($document)) {
if (isset($document['types'])) {
$root = null;
if (!empty($document['root'])) {
if (isset($document['root'])) {
$root = (int) $document['root'];
}

Expand All @@ -226,7 +226,7 @@ public static function from(mixed $document): self
}
} elseif ($document instanceof \stdClass) {
$root = null;
if (!empty($document->root)) {
if (isset($document->root)) {
$root = (int) $document->root;
}

Expand Down

0 comments on commit 6a30f0f

Please sign in to comment.