/** * @param mixed $value * * @return bool */ public function validate($value) { /** @var AbstractValidation $validation */ foreach ($this->validations as $validation) { $validation->validate($value); $this->errorStack->merge($validation->getErrorStack()); } return !$this->errorStack->hasErrors(); }
/** * @return bool */ protected function hasErrors() { return !empty($this->errors) && $this->errors->hasErrors(); }
/** * @return bool */ public function hasErrors() { return $this->errorStack->hasErrors(); }