Skip to content

Commit c091f76

Browse files
committed
Remove unnecessary if statement
1 parent 3286d74 commit c091f76

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/Updater/CustomerWithKeyUpdater.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public function updateWithUserKey(
9292
$email,
9393
UserApiInterface::EMAIL_PROPERTY,
9494
);
95+
9596
if (null !== $userByEmailFromForm &&
9697
false === array_key_exists(AbstractClient::ERROR, $userByEmailFromForm)
9798
) {
@@ -108,10 +109,7 @@ public function updateWithUserKey(
108109
return $user;
109110
}
110111

111-
if (!isset($user) || false === array_key_exists(AbstractClient::ERROR, $user)) {
112-
$user = $this->userApi->createUser($apiAwareResource, $payload);
113-
}
114-
112+
$user = $this->userApi->createUser($apiAwareResource, $payload);
115113
$this->changeCookieWithEvent($user, $apiAwareResource, $eventName);
116114

117115
return $user;
@@ -159,7 +157,7 @@ private function updateForUserWithoutEmail(
159157
public function changeCookieWithEvent(
160158
?array $user,
161159
UserComApiAwareInterface $apiAwareResource,
162-
string $eventName
160+
string $eventName,
163161
): void {
164162
if (false === is_array($user) ||
165163
false === array_key_exists('id', $user) ||

0 commit comments

Comments
 (0)