src/Helper.php
public static function object_get($object, $key, $default = null)
    {
        if (\is_null($key) || trim($key) === '') {
            return $object;
        }

        foreach (explode('.', $key) as $segment) {
            if (! \is_object($object) || ! isset($object->{$segment})) {
                return self::value($default);
            }

            $object = $object->{$segment};
        }

        return $object;
    }
public static function object_get($object, $key, $default = null)
    {
        if (\is_null($key) || trim($key) === '') {
            return $object;
        }

        foreach (explode('.', $key) as $segment) {
            if (! \is_object($object) || ! isset($object->{$segment})) {
                return self::value($default);
            }

            $object = $object->{$segment};
        }

        return $object;
    }
public static function object_get ( $ object , $ key , $ default = null ) { if ( \ is_null ( $ key ) || trim ( $ key ) === '' ) { return $ object ; } foreach ( explode ( '.' , $ key ) as $ segment ) { if ( ! \ is_object ( $ object ) || ! isset ( $ object -> { $ segment } ) ) { return self :: value ( $ default ) ; } $ object = $ object -> { $ segment } ; } return $ object ; }
Get an item from an object using "dot" notation.

@param  object  $object
@param  string  $key
@param  mixed   $default
@return mixed
Get an item from an object using dot notation .