protected function setUserInformation(UserInterface $user, UserResponseInterface $userInformation)
    {
        $accessor = PropertyAccess::createPropertyAccessor();
        $accessor->setValue($user, 'username', $this->getUniqueUserName($userInformation->getNickname()));

        if (method_exists($accessor, 'isWritable') && $accessor->isWritable($user, 'email')) {
            $accessor->setValue($user, 'email', $userInformation->getEmail());
        } elseif (method_exists($user, 'setEmail')) {
            $user->setEmail($userInformation->getEmail());
        }

        return $user;
    }
protected function setUserInformation(UserInterface $user, UserResponseInterface $userInformation)
    {
        $accessor = PropertyAccess::createPropertyAccessor();
        $accessor->setValue($user, 'username', $this->getUniqueUserName($userInformation->getNickname()));

        if (method_exists($accessor, 'isWritable') && $accessor->isWritable($user, 'email')) {
            $accessor->setValue($user, 'email', $userInformation->getEmail());
        } elseif (method_exists($user, 'setEmail')) {
            $user->setEmail($userInformation->getEmail());
        }

        return $user;
    }
protected function setUserInformation ( UserInterface $ user , UserResponseInterface $ userInformation ) { $ accessor = PropertyAccess :: createPropertyAccessor ( ) ; $ accessor -> setValue ( $ user , 'username' , $ this -> getUniqueUserName ( $ userInformation -> getNickname ( ) ) ) ; if ( method_exists ( $ accessor , 'isWritable' ) && $ accessor -> isWritable ( $ user , 'email' ) ) { $ accessor -> setValue ( $ user , 'email' , $ userInformation -> getEmail ( ) ) ; } elseif ( method_exists ( $ user , 'setEmail' ) ) { $ user -> setEmail ( $ userInformation -> getEmail ( ) ) ; } return $ user ; }
Set user information from form.

@param UserInterface         $user
@param UserResponseInterface $userInformation

@return UserInterface
Set user information from form .