src/Form/ValidationForm.php
/**
     * Defines what to execute once the From is being processed
     *
     * @param array $data Form data.
     * @return void
     * @throws BadRequestException
     */
Defines what to execute once the From is being processed
@param array $data Form data.
@return void
@throws BadRequestException
Defines what to execute once the From is being processed @param array $data Form data . @return void @throws BadRequestException
protected function _execute(array $data)
    {
        $errorMessages = ['Request Validation Error.'];
        foreach ($this->getErrors() as $field => $error) {
            if ($this->errorHandler) {
                call_user_func($this->errorHandler, $field, $error, $this->extraData);
            } else {
                $validationErrorMessages = Hash::flatten($error);
                $validationErrorMessages= array_flip($validationErrorMessages);
                $validationErrorMessages= array_keys($validationErrorMessages);
                foreach ($validationErrorMessages as $message) {
                    $errorMessages[] = "[{$field}]: {$message}";
                }
            }
        }
        throw new ValidationException(implode("\n", $errorMessages));
    }
protected function _execute ( array $ data ) { $ errorMessages = [ 'Request Validation Error.' ] ; foreach ( $ this -> getErrors ( ) as $ field => $ error ) { if ( $ this -> errorHandler ) { call_user_func ( $ this -> errorHandler , $ field , $ error , $ this -> extraData ) ; } else { $ validationErrorMessages = Hash :: flatten ( $ error ) ; $ validationErrorMessages = array_flip ( $ validationErrorMessages ) ; $ validationErrorMessages = array_keys ( $ validationErrorMessages ) ; foreach ( $ validationErrorMessages as $ message ) { $ errorMessages [ ] = " [ { $ field } ]:  { $ message } " ; } } } throw new ValidationException ( implode ( " \n " , $ errorMessages ) ) ; }
Defines what to execute once the From is being processed
 @param array $data Form data.
Defines what to execute once the From is being processed @param array $data Form data .