src/PHPDish/Bundle/UserBundle/Security/Core/User/FOSUBUserProvider.php
protected function createNewUser(UserResponseInterface $response)
    {
        $user = $this->userManager->createUser()
            ->setEnabled(true)
            ->setUsername($this->generateUsername($response))
            ->setPassword('')
            ->setEmail($response->getEmail() ?: '')
            ->setCreatedAt($now = Carbon::now())
            ->setUpdatedAt($now);

        try {
            $avatar = $this->fileDownloader->download($response->getProfilePicture());
            $user->setAvatar($avatar->getKey());
        } catch (\Exception $exception) {
            $user->setAvatar('');
        }

        return $user;
    }
protected function createNewUser(UserResponseInterface $response)
    {
        $user = $this->userManager->createUser()
            ->setEnabled(true)
            ->setUsername($this->generateUsername($response))
            ->setPassword('')
            ->setEmail($response->getEmail() ?: '')
            ->setCreatedAt($now = Carbon::now())
            ->setUpdatedAt($now);

        try {
            $avatar = $this->fileDownloader->download($response->getProfilePicture());
            $user->setAvatar($avatar->getKey());
        } catch (\Exception $exception) {
            $user->setAvatar('');
        }

        return $user;
    }
创建一个新用户.

@param UserResponseInterface $response

@return \PHPDish\Bundle\UserBundle\Model\UserInterface