Elcodi\Store\ConnectBundle\Services\OAuthUserProvider::createUser PHP Method

createUser() protected method

Create a new user from a response
protected createUser ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface
return Symfony\Component\Security\Core\User\UserInterface
    protected function createUser(UserResponseInterface $response)
    {
        /**
         * @var CustomerInterface $customer
         */
        $customer = $this->customerDirector->create();
        $customer->setEmail($response->getEmail())->setFirstname($response->getRealName());
        $this->customerDirector->save($customer);
        $this->userEventDispatcher->dispatchOnCustomerRegisteredEvent($customer);
        return $customer;
    }