Catch exceptions
This commit is contained in:
parent
00d6e24f31
commit
128e377712
|
@ -65,6 +65,11 @@ trait Getter
|
|||
*/
|
||||
final public function __isset(string $property): bool
|
||||
{
|
||||
return !empty($this->__get($property));
|
||||
try {
|
||||
$value = $this->__get($property);
|
||||
} catch (\InvalidArgumentException) {
|
||||
$value = null;
|
||||
}
|
||||
return !empty($value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,8 @@ trait Setter
|
|||
*/
|
||||
final public function __unset(string $property): void
|
||||
{
|
||||
try {
|
||||
$this->__set($property, null);
|
||||
} catch (\InvalidArgumentException) {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue