Add ObjectIssetFix Trait
This commit is contained in:
parent
b8a4e9d660
commit
2ab98a36d5
15
src/Traits/ObjectIssetFix.php
Normal file
15
src/Traits/ObjectIssetFix.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Fix for when there is a call to pluck() for values resolved via __get()
|
||||
*/
|
||||
namespace Leenooks\Traits;
|
||||
|
||||
trait ObjectIssetFix
|
||||
{
|
||||
// Fix for a call to pluck('something') (which is resolved via __get()), but it returns false.
|
||||
public function __isset($key)
|
||||
{
|
||||
return (bool)$this->{$key};
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user