merged branch vicb/minor_cleanup (PR #4430)

Commits
-------

59c4f55 a few minor changes

Discussion
----------

a few minor changes / cleanup

---------------------------------------------------------------------------

by travisbot at 2012-05-27T07:58:52Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1446431) (merged bb7ae326 into 9e951991).
This commit is contained in:
Fabien Potencier 2012-05-30 07:21:14 +02:00
commit 3273d5189e
3 changed files with 10 additions and 11 deletions

View File

@ -47,18 +47,17 @@ class FormValidator extends ConstraintValidator
}
/* @var FormInterface $form */
$path = $this->context->getPropertyPath();
$graphWalker = $this->context->getGraphWalker();
$groups = $this->getValidationGroups($form);
$config = $form->getConfig();
if (!empty($path)) {
$path .= '.';
}
if ($form->isSynchronized()) {
// Validate the form data only if transformation succeeded
$path = $this->context->getPropertyPath();
$graphWalker = $this->context->getGraphWalker();
$groups = $this->getValidationGroups($form);
if (!empty($path)) {
$path .= '.';
}
// Validate the data against its own constraints
if (self::allowDataWalking($form)) {

View File

@ -58,7 +58,7 @@ class MappingRule
*
* @param string $propertyPath The property path to match against the rule.
*
* @return Boolean|FormInterface The mapped form or false.
* @return null|FormInterface The mapped form or null.
*/
public function match($propertyPath)
{
@ -66,7 +66,7 @@ class MappingRule
return $this->getTarget();
}
return false;
return null;
}
/**

View File

@ -176,7 +176,7 @@ class ViolationMapper implements ViolationMapperInterface
/* @var MappingRule $rule */
// Mapping rule matches completely, terminate.
if (false !== ($form = $rule->match($chunk))) {
if (null !== ($form = $rule->match($chunk))) {
return $form;
}