src/User/src/Handler/UserHandler.php
/**
     * Update user by uuid
     *
     * @param ServerRequestInterface $request
     * @return ResponseInterface
     */
Update user by uuid
@param ServerRequestInterface $request
@return ResponseInterface
Update user by uuid @param ServerRequestInterface $request @return ResponseInterface
public function patch(ServerRequestInterface $request): ResponseInterface
    {
        $inputFilter = (new UpdateUserInputFilter())->getInputFilter();
        $inputFilter->setData($request->getParsedBody());
        if (!$inputFilter->isValid()) {
            return $this->errorResponse($inputFilter->getMessages());
        }
        try {
            $uuid = $request->getAttribute('uuid');
            $user = $this->userService->findOneBy(['uuid' => $uuid]);
            if (!($user instanceof User)) {
                return $this->notFoundResponse(sprintf(Message::NOT_FOUND_BY_UUID, 'user', $uuid));
            }
            $user = $this->userService->updateUser($user, $inputFilter->getValues());
            return $this->createResponse($request, $user);
        } catch (Throwable $exception) {
            return $this->errorResponse($exception->getMessage());
        }
    }
public function patch ( ServerRequestInterface $ request ) : ResponseInterface { $ inputFilter = ( new UpdateUserInputFilter ( ) ) -> getInputFilter ( ) ; $ inputFilter -> setData ( $ request -> getParsedBody ( ) ) ; if ( ! $ inputFilter -> isValid ( ) ) { return $ this -> errorResponse ( $ inputFilter -> getMessages ( ) ) ; } try { $ uuid = $ request -> getAttribute ( 'uuid' ) ; $ user = $ this -> userService -> findOneBy ( [ 'uuid' => $ uuid ] ) ; if ( ! ( $ user instanceof User ) ) { return $ this -> notFoundResponse ( sprintf ( Message :: NOT_FOUND_BY_UUID , 'user' , $ uuid ) ) ; } $ user = $ this -> userService -> updateUser ( $ user , $ inputFilter -> getValues ( ) ) ; return $ this -> createResponse ( $ request , $ user ) ; } catch ( Throwable $ exception ) { return $ this -> errorResponse ( $ exception -> getMessage ( ) ) ; } }
Update user by uuid
 @param ServerRequestInterface $request
 @return ResponseInterface
Update user by uuid @param ServerRequestInterface $request @return ResponseInterface