diff --git a/src/Model/Document.php b/src/Model/Document.php index 6ca49d5..295e1c3 100644 --- a/src/Model/Document.php +++ b/src/Model/Document.php @@ -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']; } @@ -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; }