src/Services/EntityService.php
protected function validate(array $data, array $rules = null): void
    {
        $validator = $this->validatorFactory->make($data, $rules ?? $this->getValidationRules());
        if ($validator->fails()) {
            throw new ValidationException($validator);
        }
    }
protected function validate(array $data, array $rules = null): void
    {
        $validator = $this->validatorFactory->make($data, $rules ?? $this->getValidationRules());
        if ($validator->fails()) {
            throw new ValidationException($validator);
        }
    }
protected function validate ( array $ data , array $ rules = null ) : void { $ validator = $ this -> validatorFactory -> make ( $ data , $ rules ?? $ this -> getValidationRules ( ) ) ; if ( $ validator -> fails ( ) ) { throw new ValidationException ( $ validator ) ; } }
Validates data.

@param array $data Data to validate
@param array|null $rules Validation rules

@throws ValidationException

@return void
Validates data .