CS fix, getConstraints renamed
This commit is contained in:
parent
09c191136a
commit
dd12ff836d
@ -23,5 +23,5 @@ interface ConstraintProviderInterface
|
|||||||
*
|
*
|
||||||
* @param Mapping\ClassMetadata
|
* @param Mapping\ClassMetadata
|
||||||
*/
|
*/
|
||||||
public function getConstraints(ClassMetadata $metadata);
|
function registerConstraints(ClassMetadata $metadata);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ class Validator implements ValidatorInterface
|
|||||||
if ($object instanceof ConstraintProviderInterface) {
|
if ($object instanceof ConstraintProviderInterface) {
|
||||||
$dynamicMetadata = new ClassMetadata(get_class($object));
|
$dynamicMetadata = new ClassMetadata(get_class($object));
|
||||||
$dynamicMetadata->mergeConstraints($metadata);
|
$dynamicMetadata->mergeConstraints($metadata);
|
||||||
$object->getConstraints($dynamicMetadata);
|
$object->registerConstraints($dynamicMetadata);
|
||||||
$metadata = $dynamicMetadata;
|
$metadata = $dynamicMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ class DynamicConstraintsEntity implements ConstraintProviderInterface
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConstraints(ClassMetadata $metadata)
|
public function registerConstraints(ClassMetadata $metadata)
|
||||||
{
|
{
|
||||||
if ($this->validationEnabled) {
|
if ($this->validationEnabled) {
|
||||||
$metadata->addPropertyConstraint('firstValue', new FailingConstraint());
|
$metadata->addPropertyConstraint('firstValue', new FailingConstraint());
|
||||||
|
Reference in New Issue
Block a user