Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 9 |
ObjectUtil | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 9 |
getFromObject | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 9 |
<?php | |
declare(strict_types = 1); | |
namespace Siesta\Util; | |
/** | |
* @author Gregor Müller | |
*/ | |
class ObjectUtil | |
{ | |
/** | |
* @param string $object | |
* @param string $key | |
* | |
* @return string | |
*/ | |
public static function getFromObject($object, $key) | |
{ | |
if ($object == null) { | |
return null; | |
} | |
if (!isset ($object->{$key})) { | |
return null; | |
} | |
return $object->{$key}; | |
} | |
} |