Skip to content

Commit 948cd1b

Browse files
Reduce common control flows
1 parent 2b23124 commit 948cd1b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Mapping/Loader/PropertyInfoLoader.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,6 @@ public function loadClassMetadata(ClassMetadata $metadata): bool
133133
$metadata->addPropertyConstraint($property, new Type(['type' => 'scalar']));
134134
}
135135
}
136-
137-
if (!$nullable && !$hasNotBlankConstraint && !$hasNotNullConstraint) {
138-
$metadata->addPropertyConstraint($property, new NotNull());
139-
}
140136
} else {
141137
if ($hasTypeConstraint) {
142138
continue;
@@ -157,10 +153,10 @@ public function loadClassMetadata(ClassMetadata $metadata): bool
157153
if (null !== $typeConstraint = $this->getTypeConstraint($type)) {
158154
$metadata->addPropertyConstraint($property, $typeConstraint);
159155
}
156+
}
160157

161-
if (!$nullable && !$hasNotBlankConstraint && !$hasNotNullConstraint) {
162-
$metadata->addPropertyConstraint($property, new NotNull());
163-
}
158+
if (!$nullable && !$hasNotBlankConstraint && !$hasNotNullConstraint) {
159+
$metadata->addPropertyConstraint($property, new NotNull());
164160
}
165161
}
166162

0 commit comments

Comments
 (0)