Example #1
0
 /**
  * @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();
 }
Example #2
0
 /**
  * @return bool
  */
 protected function hasErrors()
 {
     return !empty($this->errors) && $this->errors->hasErrors();
 }
Example #3
0
 /**
  * @return bool
  */
 public function hasErrors()
 {
     return $this->errorStack->hasErrors();
 }