src/Service/UserService.php
public function editProfile($data)
    {
        /* @var $user UserInterface */
        if (!($user = $this->hydrate($data, $this->getEditProfileForm()))) {
            return;
        }

    	$eventManager = $this->getEventManager();
    	$eventManager->trigger(__FUNCTION__, $this, compact('user'));

    	$this->getMapper()->update($user)->save();

    	$eventManager->trigger(__FUNCTION__ . '.post', $this, compact('user'));

    	return $user;
    }
public function editProfile($data)
    {
        /* @var $user UserInterface */
        if (!($user = $this->hydrate($data, $this->getEditProfileForm()))) {
            return;
        }

    	$eventManager = $this->getEventManager();
    	$eventManager->trigger(__FUNCTION__, $this, compact('user'));

    	$this->getMapper()->update($user)->save();

    	$eventManager->trigger(__FUNCTION__ . '.post', $this, compact('user'));

    	return $user;
    }
Edit user profile

@param array|UserInterface $data
@return UserInterface|void