public static function hasMethod($object, $method)
    {
        if (empty($object)) {
            return false;
        }
        if (method_exists($object, $method)) {
            return true;
        }
        return method_exists($object, 'hasMethod') && $object->hasMethod($method);
    }