Skip to content

Commit 33a166c

Browse files
committed
modify return of ValueProvider::getValue()
return null if the entry doesn't exist instead of throwing an exception
1 parent 5065a0d commit 33a166c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/Endpoint/Binder/Providers/ValueProvider.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,11 @@ public function __construct(array $values = [])
2525

2626
/**
2727
* @return mixed Finds an entry of the container by its identifier and returns it.
28+
* Return null if the entry does not exist.
2829
*/
2930
public function getValue(string $key)
3031
{
31-
if (isset($this->values[$key])) {
32-
return $this->values[$key];
33-
}
34-
35-
throw new \Exception("No entry was found");
32+
return $this->values[$key] ?? null;
3633
}
3734

3835
/**

0 commit comments

Comments
 (0)