private function createNewToken(AbstractUserInterface $user)
    {
        return new UsernamePasswordToken(
            $user,
            null,
            $this->providerKey,
            $user->getRoles()
        );
    }
private function createNewToken(AbstractUserInterface $user)
    {
        return new UsernamePasswordToken(
            $user,
            null,
            $this->providerKey,
            $user->getRoles()
        );
    }
private function createNewToken ( AbstractUserInterface $ user ) { return new UsernamePasswordToken ( $ user , null , $ this -> providerKey , $ user -> getRoles ( ) ) ; }
Generate new token given a user.

@param AbstractUserInterface $user User

@return UsernamePasswordToken New token
Generate new token given a user .