excludeFromValidation) { $result = true; return; } if ($this->triggerTestValidationError) { $result = false; $validator->validationError($this->owner->getName(), 'A test error message'); return; } } public function setExcludeFromValidation(bool $exclude) { $this->excludeFromValidation = $exclude; } public function setTriggerTestValidationError(bool $triggerTestValidationError) { $this->triggerTestValidationError = $triggerTestValidationError; } }