public function put(Request $request)
    {
        $user = $this->getUser();

        $userValidationCopy = clone $user;

        // Validate the modified fields
        $content = $this->getContentAsArray($request);

        $errors = $this->userValidator->validate($content, $user);

        if (count($errors) > 0) {
            return $this->createConstraintViolationResponse($errors);
        }

        $userValidationCopy->exchangeArray($content ?: [])->getArrayCopy();

        try {
            $user = $this->userService->update($user, $this->getContentAsArray($request));
        } catch (OutOfBoundsException $e) {
            return $this->createEmailNotUniqueResponse();
        }

        return $this->userArrayWithoutPassword($user);
    }