mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-26 03:02:56 +02:00
using exception instead of null return (preventing potential NPE)
This commit is contained in:
@ -70,7 +70,7 @@ class UserMapper
|
||||
{
|
||||
$result = $this->_adapter->find($id);
|
||||
if (0 == count($result)) {
|
||||
return;
|
||||
throw new \InvalidArgumentException("User #$id not found");
|
||||
}
|
||||
$row = $result->current();
|
||||
|
||||
|
Reference in New Issue
Block a user