Esempio n. 1
0
 /**
  * @param Property $property
  * @param $value
  * @return mixed
  * @throws RequirementValidationException
  */
 public function validate(Property $property, $value)
 {
     if ($value === null) {
         return;
     }
     if (PropertyType::isNumeric($property->getType())) {
         if ($value > $this->length) {
             throw RequirementValidationException::make($property, $this, $value);
         }
     } else {
         if (mb_strlen($value) > $this->length) {
             throw RequirementValidationException::make($property, $this, $value);
         }
     }
 }