function MemberMetadata::checkConstraint
1 call to MemberMetadata::checkConstraint()
- MemberMetadata::addConstraint in vendor/
symfony/ validator/ Mapping/ MemberMetadata.php - Adds a constraint.
File
-
vendor/
symfony/ validator/ Mapping/ MemberMetadata.php, line 148
Class
- MemberMetadata
- Stores all metadata needed for validating a class property.
Namespace
Symfony\Component\Validator\MappingCode
private function checkConstraint(Constraint $constraint) : void {
if (!\in_array(Constraint::PROPERTY_CONSTRAINT, (array) $constraint->getTargets(), true)) {
throw new ConstraintDefinitionException(\sprintf('The constraint "%s" cannot be put on properties or getters.', get_debug_type($constraint)));
}
if ($constraint instanceof Composite) {
foreach ($constraint->getNestedConstraints() as $nestedConstraint) {
$this->checkConstraint($nestedConstraint);
}
}
}