protected function validateOverwritePermissions($memberOrRole, $allow, $deny = 0) {
        $options = array();
        
        if($memberOrRole instanceof \CharlotteDunois\Yasmin\Models\GuildMember) {
            $memberOrRole = $memberOrRole->id;
            $options['type'] = 'member';
        } elseif($memberOrRole instanceof \CharlotteDunois\Yasmin\Models\Role) {
            $memberOrRole = $memberOrRole->id;
            $options['type'] = 'role';
        } else {
            try {
                $memberOrRole = $this->guild->roles->resolve($memberOrRole)->id;
                $options['type'] = 'role';
            } catch (\InvalidArgumentException $e) {
                $options['type'] = 'member';
            }
        }
        
        if(!\is_int($allow) && !($allow instanceof \CharlotteDunois\Yasmin\Models\Permissions)) {
            throw new \InvalidArgumentException('Allow has to be an int or an instance of Permissions');
        }
        
        if(!\is_int($deny) && !($deny instanceof \CharlotteDunois\Yasmin\Models\Permissions)) {
            throw new \InvalidArgumentException('Deny has to be an int or an instance of Permissions');
        }
        
        if(\json_encode($allow) === \json_encode($deny)) {
            throw new \InvalidArgumentException('Allow and deny must have different permissions');
        }
        
        $options['allow'] = $allow;
        $options['deny'] = $deny;
        
        return array($memberOrRole, $options);
    }