Gateway/Validator/ResponseValidator.php
public function validate(array $validationSubject) {
        
        $isValid        = true;
        $errorMessages  = [];

        foreach($this->rules() as $rule) {
            
            $isRuleValid = $rule->isValid($validationSubject);
            
            if( ! $isRuleValid ) {
                $isValid = false;
                $errorMessages[] = $rule->getErrorMessage();
                
                if($this->stopInFirstError) {
                    break;
                }
            }
        }

      return $this->createResult($isValid, $errorMessages);
    }
public function validate(array $validationSubject) {
        
        $isValid        = true;
        $errorMessages  = [];

        foreach($this->rules() as $rule) {
            
            $isRuleValid = $rule->isValid($validationSubject);
            
            if( ! $isRuleValid ) {
                $isValid = false;
                $errorMessages[] = $rule->getErrorMessage();
                
                if($this->stopInFirstError) {
                    break;
                }
            }
        }

      return $this->createResult($isValid, $errorMessages);
    }
public function validate ( array $ validationSubject ) { $ isValid = true ; $ errorMessages = [ ] ; foreach ( $ this -> rules ( ) as $ rule ) { $ isRuleValid = $ rule -> isValid ( $ validationSubject ) ; if ( ! $ isRuleValid ) { $ isValid = false ; $ errorMessages [ ] = $ rule -> getErrorMessage ( ) ; if ( $ this -> stopInFirstError ) { break ; } } } return $ this -> createResult ( $ isValid , $ errorMessages ) ; }
Performs domain-related validation for business object

@param array $validationSubject
@return ResultInterface
Performs domain - related validation for business object