[Validator] Simplified validateNodeForGroup
This commit is contained in:
parent
eeed509dfc
commit
5c479d803c
@ -646,7 +646,6 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
|||||||
*/
|
*/
|
||||||
private function validateNodeForGroup($value, $objectHash, MetadataInterface $metadata = null, $group, ExecutionContextInterface $context)
|
private function validateNodeForGroup($value, $objectHash, MetadataInterface $metadata = null, $group, ExecutionContextInterface $context)
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
$context->setGroup($group);
|
$context->setGroup($group);
|
||||||
|
|
||||||
foreach ($metadata->findConstraints($group) as $constraint) {
|
foreach ($metadata->findConstraints($group) as $constraint) {
|
||||||
@ -676,14 +675,6 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
|||||||
$validator->initialize($context);
|
$validator->initialize($context);
|
||||||
$validator->validate($value, $constraint);
|
$validator->validate($value, $constraint);
|
||||||
}
|
}
|
||||||
|
|
||||||
$context->setGroup(null);
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
// Should be put into a finally block once we switch to PHP 5.5
|
|
||||||
$context->setGroup(null);
|
|
||||||
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user