From 7860bb463d388efa10993bc12ff58b4f80f8d6c1 Mon Sep 17 00:00:00 2001 From: Michael Hirschler Date: Wed, 2 Dec 2015 14:59:04 +0100 Subject: [PATCH] [Validator] fixed raising violations to a maximum of one --- .../Component/Validator/Constraints/BicValidator.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Symfony/Component/Validator/Constraints/BicValidator.php b/src/Symfony/Component/Validator/Constraints/BicValidator.php index de327085f5..f476713c74 100644 --- a/src/Symfony/Component/Validator/Constraints/BicValidator.php +++ b/src/Symfony/Component/Validator/Constraints/BicValidator.php @@ -38,6 +38,8 @@ class BicValidator extends ConstraintValidator ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Bic::INVALID_LENGTH_ERROR) ->addViolation(); + + return; } // must contain alphanumeric values only @@ -46,6 +48,8 @@ class BicValidator extends ConstraintValidator ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Bic::INVALID_CHARACTERS_ERROR) ->addViolation(); + + return; } // first 4 letters must be alphabetic (bank code) @@ -54,6 +58,8 @@ class BicValidator extends ConstraintValidator ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Bic::INVALID_BANK_CODE_ERROR) ->addViolation(); + + return; } // next 2 letters must be alphabetic (country code) @@ -62,6 +68,8 @@ class BicValidator extends ConstraintValidator ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Bic::INVALID_COUNTRY_CODE_ERROR) ->addViolation(); + + return; } // should contain uppercase characters only @@ -70,6 +78,8 @@ class BicValidator extends ConstraintValidator ->setParameter('{{ value }}', $this->formatValue($value)) ->setCode(Bic::INVALID_CASE_ERROR) ->addViolation(); + + return; } } }