Skip to content

Commit 9dcad52

Browse files
authored
Add get method to Results
1 parent c186f69 commit 9dcad52

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Algos/Result.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ public function with(string $key, mixed $value = null): static
6363
return $this;
6464
}
6565

66+
public function get(string $key, mixed $default = null): mixed
67+
{
68+
return $this->meta[$key] ?? $default;
69+
}
70+
6671
public function merge(array $meta): static
6772
{
6873
$this->meta = array_merge_recursive($this->meta, $meta);

0 commit comments

Comments
 (0)