public function removeMember($projectId, $userId, array $params = [])
    {
        $memberships = $this->all($projectId, $params);
        if (!isset($memberships['memberships']) || !is_array($memberships['memberships'])) {
            return;
        }
        $removed = false;
        foreach ($memberships['memberships'] as $membership) {
            if (isset($membership['id']) && isset($membership['user']['id']) && $membership['user']['id'] === $userId) {
                $removed = $this->remove($membership['id']);
            }
        }

        return $removed;
    }
public function removeMember($projectId, $userId, array $params = [])
    {
        $memberships = $this->all($projectId, $params);
        if (!isset($memberships['memberships']) || !is_array($memberships['memberships'])) {
            return;
        }
        $removed = false;
        foreach ($memberships['memberships'] as $membership) {
            if (isset($membership['id']) && isset($membership['user']['id']) && $membership['user']['id'] === $userId) {
                $removed = $this->remove($membership['id']);
            }
        }

        return $removed;
    }
public function removeMember ( $ projectId , $ userId , array $ params = [ ] ) { $ memberships = $ this -> all ( $ projectId , $ params ) ; if ( ! isset ( $ memberships [ 'memberships' ] ) || ! is_array ( $ memberships [ 'memberships' ] ) ) { return ; } $ removed = false ; foreach ( $ memberships [ 'memberships' ] as $ membership ) { if ( isset ( $ membership [ 'id' ] ) && isset ( $ membership [ 'user' ] [ 'id' ] ) && $ membership [ 'user' ] [ 'id' ] === $ userId ) { $ removed = $ this -> remove ( $ membership [ 'id' ] ) ; } } return $ removed ; }
Delete membership of project by user id.

@see http://www.redmine.org/projects/redmine/wiki/Rest_Memberships#DELETE

@param int   $projectId id of project
@param int   $userId    id of user
@param array $params    optional parameters to be passed to the api (offset, limit, ...)

@return false|\SimpleXMLElement|string
Delete membership of project by user id .