using exception instead of null return (preventing potential NPE)

This commit is contained in:
Florent
2013-07-08 09:50:49 +02:00
parent b858179dd9
commit cf0036babb
2 changed files with 16 additions and 2 deletions

View File

@ -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();