public function update(User &$user) { $this->throwValidationErrors($user); $this->userRepository->update($user); $this->eventDispatcher->dispatch($user->releaseEvents()); }