function RangeValidator::getLimit
1 call to RangeValidator::getLimit()
- RangeValidator::validate in vendor/
symfony/ validator/ Constraints/ RangeValidator.php - Checks if the passed value is valid.
File
-
vendor/
symfony/ validator/ Constraints/ RangeValidator.php, line 146
Class
- RangeValidator
- @author Bernhard Schussek <bschussek@gmail.com>
Namespace
Symfony\Component\Validator\ConstraintsCode
private function getLimit(?string $propertyPath, mixed $default, Constraint $constraint) : mixed {
if (null === $propertyPath) {
return $default;
}
if (null === ($object = $this->context
->getObject())) {
return $default;
}
try {
return $this->getPropertyAccessor()
->getValue($object, $propertyPath);
} catch (NoSuchPropertyException $e) {
throw new ConstraintDefinitionException(\sprintf('Invalid property path "%s" provided to "%s" constraint: ', $propertyPath, get_debug_type($constraint)) . $e->getMessage(), 0, $e);
} catch (UninitializedPropertyException) {
return null;
}
}