Return false instead of null for boolean attributes
This commit is contained in:
@@ -25,7 +25,11 @@ abstract class AbstractRecord implements \JsonSerializable
|
||||
if ($this->__isset($attr)) {
|
||||
return $this->record[$key];
|
||||
} elseif ($this->validAttribute($attr)) {
|
||||
return null;
|
||||
if (preg_match('/^is_/', $key)) {
|
||||
return false;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
throw new \RuntimeException("Unknown attribute: $attr");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user