Skip to content

Commit b15afe3

Browse files
committed
Fix regression in last release
We accidentally changed behavior of get method on documents by no longer allowing fetching the entire document by passing in null
1 parent b37840d commit b15afe3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/BasicDocument.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ public function getId(): string
3030
return $this->id;
3131
}
3232

33-
public function has(string $path): bool
33+
public function has(?string $path): bool
3434
{
35+
if (!$path) {
36+
return true;
37+
}
3538
try {
3639
$this->reference($path)->hasValue();
3740
return true;

src/DocumentCollection.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function getId(): string
5151
public function has(?string $path): bool
5252
{
5353
if (!$path) {
54-
return false;
54+
return true;
5555
}
5656
foreach ($this->documents as $document) {
5757
if ($document->has($path)) {
@@ -63,9 +63,6 @@ public function has(?string $path): bool
6363

6464
public function get(string $path = null): mixed
6565
{
66-
if (!$path) {
67-
return false;
68-
}
6966
foreach ($this->documents as $document) {
7067
if ($document->has($path)) {
7168
return $document->get($path);

0 commit comments

Comments
 (0)