private function isUserConflict(EzUser $user, TokenInterface $previousToken = null)
    {
        if ($previousToken === null || !$previousToken instanceof UsernamePasswordToken) {
            return false;
        }

        $previousUser = $previousToken->getUser();
        if (!$previousUser instanceof EzUser) {
            return false;
        }

        $wasAnonymous = $previousUser->getAPIUser()->getUserId() == $this->configResolver->getParameter('anonymous_user_id');
        // TODO: isEqualTo is not on the interface
        return !$wasAnonymous && !$user->isEqualTo($previousUser);
    }
private function isUserConflict(EzUser $user, TokenInterface $previousToken = null)
    {
        if ($previousToken === null || !$previousToken instanceof UsernamePasswordToken) {
            return false;
        }

        $previousUser = $previousToken->getUser();
        if (!$previousUser instanceof EzUser) {
            return false;
        }

        $wasAnonymous = $previousUser->getAPIUser()->getUserId() == $this->configResolver->getParameter('anonymous_user_id');
        // TODO: isEqualTo is not on the interface
        return !$wasAnonymous && !$user->isEqualTo($previousUser);
    }
private function isUserConflict ( EzUser $ user , TokenInterface $ previousToken = null ) { if ( $ previousToken === null || ! $ previousToken instanceof UsernamePasswordToken ) { return false ; } $ previousUser = $ previousToken -> getUser ( ) ; if ( ! $ previousUser instanceof EzUser ) { return false ; } $ wasAnonymous = $ previousUser -> getAPIUser ( ) -> getUserId ( ) == $ this -> configResolver -> getParameter ( 'anonymous_user_id' ) ; // TODO: isEqualTo is not on the interface return ! $ wasAnonymous && ! $ user -> isEqualTo ( $ previousUser ) ; }
Checks if newly matched user is conflicting with previously non-anonymous logged in user, if any.

@param EzUser $user
@param TokenInterface $previousToken

@return bool
Checks if newly matched user is conflicting with previously non - anonymous logged in user if any .