src/User.php
public function deleteMembership($userId, $organization = '')
    {
        try {
            $response = $this
            ->call('DELETE', implode('/', [self::ORGANIZATION_RESOURCE, $this->getOrganizationName($organization), 'memberships', $userId]));
        } catch (GuzzleException $e) {
            if (404 == $e->getCode()) {
                return false;
            }

            throw $e;
        }

        return '204' == $response->getStatusCode();
    }
public function deleteMembership($userId, $organization = '')
    {
        try {
            $response = $this
            ->call('DELETE', implode('/', [self::ORGANIZATION_RESOURCE, $this->getOrganizationName($organization), 'memberships', $userId]));
        } catch (GuzzleException $e) {
            if (404 == $e->getCode()) {
                return false;
            }

            throw $e;
        }

        return '204' == $response->getStatusCode();
    }
public function deleteMembership ( $ userId , $ organization = '' ) { try { $ response = $ this -> call ( 'DELETE' , implode ( '/' , [ self :: ORGANIZATION_RESOURCE , $ this -> getOrganizationName ( $ organization ) , 'memberships' , $ userId ] ) ) ; } catch ( GuzzleException $ e ) { if ( 404 == $ e -> getCode ( ) ) { return false ; } throw $ e ; } return '204' == $ response -> getStatusCode ( ) ; }
Deletes a membership for the given organization and user's ID.

@since 1.7.0

@param string $organization Organization
@param string $userId       User ID

@throws GuzzleException
@throws \RuntimeException

@return bool
Deletes a membership for the given organization and user s ID .