Exemplo n.º 1
0
 /**
  * @inheritDoc
  */
 public function validate(AbstractAttribute $attribute, $data, $params = [])
 {
     try {
         return $this->validation()->validate($data, 'minLength:' . $params[0]);
     } catch (ValidationException $e) {
         throw ExceptionFactory::getInstance()->attributeValidationException($attribute, $e);
     }
 }
Exemplo n.º 2
0
 /**
  * @inheritDoc
  */
 public function validate(AbstractAttribute $attribute, $data, $params = [])
 {
     try {
         return $this->validation()->validate($data, 'creditCardNumber');
     } catch (ValidationException $e) {
         throw ExceptionFactory::getInstance()->attributeValidationException($attribute, $e);
     }
 }
Exemplo n.º 3
0
 /**
  * @inheritDoc
  */
 public function validate(AbstractAttribute $attribute, $data, $params = [])
 {
     $params = is_string($params) ? $params : implode(':', $params);
     try {
         return $this->validation()->validate($data, 'in:' . $params);
     } catch (ValidationException $e) {
         throw ExceptionFactory::getInstance()->attributeValidationException($attribute, $e);
     }
 }