Skip to content

Commit 7860bb4

Browse files
committed
[Validator] fixed raising violations to a maximum of one
1 parent bc642fb commit 7860bb4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Symfony/Component/Validator/Constraints/BicValidator.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public function validate($value, Constraint $constraint)
3838
->setParameter('{{ value }}', $this->formatValue($value))
3939
->setCode(Bic::INVALID_LENGTH_ERROR)
4040
->addViolation();
41+
42+
return;
4143
}
4244

4345
// must contain alphanumeric values only
@@ -46,6 +48,8 @@ public function validate($value, Constraint $constraint)
4648
->setParameter('{{ value }}', $this->formatValue($value))
4749
->setCode(Bic::INVALID_CHARACTERS_ERROR)
4850
->addViolation();
51+
52+
return;
4953
}
5054

5155
// first 4 letters must be alphabetic (bank code)
@@ -54,6 +58,8 @@ public function validate($value, Constraint $constraint)
5458
->setParameter('{{ value }}', $this->formatValue($value))
5559
->setCode(Bic::INVALID_BANK_CODE_ERROR)
5660
->addViolation();
61+
62+
return;
5763
}
5864

5965
// next 2 letters must be alphabetic (country code)
@@ -62,6 +68,8 @@ public function validate($value, Constraint $constraint)
6268
->setParameter('{{ value }}', $this->formatValue($value))
6369
->setCode(Bic::INVALID_COUNTRY_CODE_ERROR)
6470
->addViolation();
71+
72+
return;
6573
}
6674

6775
// should contain uppercase characters only
@@ -70,6 +78,8 @@ public function validate($value, Constraint $constraint)
7078
->setParameter('{{ value }}', $this->formatValue($value))
7179
->setCode(Bic::INVALID_CASE_ERROR)
7280
->addViolation();
81+
82+
return;
7383
}
7484
}
7585
}

0 commit comments

Comments
 (0)