Nullable patterns no longer throw exceptions (#1210)

Nullable patterns no longer throw exceptions
This commit is contained in:
Martijn van Kempen 2018-01-26 17:09:38 +01:00 committed by David Buchmann
parent 819cbe354f
commit dad7f77351

View File

@ -104,8 +104,12 @@ class SymfonyConstraintAnnotationReader
/** /**
* Append the pattern from the constraint to the existing pattern. * Append the pattern from the constraint to the existing pattern.
*/ */
private function appendPattern(Schema $property, string $newPattern) private function appendPattern(Schema $property, $newPattern)
{ {
if (null === $newPattern) {
return;
}
if (null !== $property->getPattern()) { if (null !== $property->getPattern()) {
$property->setPattern(sprintf('%s, %s', $property->getPattern(), $newPattern)); $property->setPattern(sprintf('%s, %s', $property->getPattern(), $newPattern));
} else { } else {