private function validateCreateRequest(Request $request)
    {
        if ($request->getContent() === '') {
            throw new BadRequestHttpException('Empty JSON data', null, 1500559729);
        }
        if (empty($request->get('login_name')) || empty($request->get('password'))) {
            throw new BadRequestHttpException('Incomplete credentials', null, 1500562647);
        }
    }
private function validateCreateRequest(Request $request)
    {
        if ($request->getContent() === '') {
            throw new BadRequestHttpException('Empty JSON data', null, 1500559729);
        }
        if (empty($request->get('login_name')) || empty($request->get('password'))) {
            throw new BadRequestHttpException('Incomplete credentials', null, 1500562647);
        }
    }
private function validateCreateRequest ( Request $ request ) { if ( $ request -> getContent ( ) === '' ) { throw new BadRequestHttpException ( 'Empty JSON data' , null , 1500559729 ) ; } if ( empty ( $ request -> get ( 'login_name' ) ) || empty ( $ request -> get ( 'password' ) ) ) { throw new BadRequestHttpException ( 'Incomplete credentials' , null , 1500562647 ) ; } }
Validates the request. If is it not valid, throws an exception.

@param Request $request

@return void

@throws BadRequestHttpException
Validates the request . If is it not valid throws an exception .