8000 Early return if not entity · symfony/maker-bundle@b4b9710 · GitHub
[go: up one dir, main page]

Skip to content

Commit b4b9710

Browse files
Early return if not entity
Co-authored-by: Jesse Rushlow <40327885+jrushlow@users.noreply.github.com>
1 parent ec6fc21 commit b4b9710

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/Security/UserClassBuilder.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,16 @@ private function addEraseCredentials(ClassSourceManipulator $manipulator): void
264264

265265
private function addUniqueConstraint(ClassSourceManipulator $manipulator, UserClassConfiguration $userClassConfig): void
266266
{
267-
if ($userClassConfig->isEntity()) {
268-
$manipulator->addAttributeToClass(
269-
'ORM\\UniqueConstraint',
270-
[
271-
'name' => 'UNIQ_IDENTIFIER_'.strtoupper(Str::asSnakeCase($userClassConfig->getIdentityPropertyName())),
272-
'fields' => [$userClassConfig->getIdentityPropertyName()],
273-
]
274-
);
267+
if (!$userClassConfig->isEntity()) {
268+
return;
275269
}
270+
271+
$manipulator->addAttributeToClass(
272+
'ORM\\UniqueConstraint',
273+
[
274+
'name' => 'UNIQ_IDENTIFIER_'.strtoupper(Str::asSnakeCase($userClassConfig->getIdentityPropertyName())),
275+
'fields' => [$userClassConfig->getIdentityPropertyName()],
276+
]
277+
);
276278
}
277279
}

0 commit comments

Comments
 (0)
0