original_string: public function createViolationErrorResponse(ViolationListException $exception)
      {
          $errorData = [];
  
          /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
          foreach ($exception->getViolationList() as $violation) {
              $errorData[$violation->getPropertyPath()] = $violation->getMessage();
          }
  
          // Try get code from errors storage via exception
          $errors = $this->handler->getErrors();
          $code = $errors->hasException($exception) ? $errors->getExceptionCode($exception) : 0;
  
          return $this->createErrorResponse($code, null, $errorData);
      }
code: public function createViolationErrorResponse(ViolationListException $exception)
      {
          $errorData = [];
  
          /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
          foreach ($exception->getViolationList() as $violation) {
              $errorData[$violation->getPropertyPath()] = $violation->getMessage();
          }
  
          // Try get code from errors storage via exception
          $errors = $this->handler->getErrors();
          $code = $errors->hasException($exception) ? $errors->getExceptionCode($exception) : 0;
  
          return $this->createErrorResponse($code, null, $errorData);
      }
code_tokens: public function createViolationErrorResponse ( ViolationListException $ exception ) { $ errorData = [ ] ; /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */ foreach ( $ exception -> getViolationList ( ) as $ violation ) { $ errorData [ $ violation -> getPropertyPath ( ) ] = $ violation -> getMessage ( ) ; } // Try get code from errors storage via exception $ errors = $ this -> handler -> getErrors ( ) ; $ code = $ errors -> hasException ( $ exception ) ? $ errors -> getExceptionCode ( $ exception ) : 0 ; return $ this -> createErrorResponse ( $ code , null , $ errorData ) ; }
docstring: Create violation error response
  
  @param ViolationListException $exception
  
  @return JsonResponse
docstring_tokens: Create violation error response