Skip to content

Commit 81e3db6

Browse files
committed
refactor: rename variable names
1 parent 612f896 commit 81e3db6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Models/UserModel.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ protected function fetchIdentities(array $data): array
9393
/**
9494
* Map our users by ID to make assigning simpler
9595
*
96+
* @param array $data Event $data
9697
* @param UserIdentity[] $identities
9798
*
9899
* @return User[] UserId => User object
@@ -110,11 +111,13 @@ private function assignIdentities(array $data, array $identities): array
110111
unset($users);
111112

112113
// Now assign the identities to the user
113-
foreach ($identities as $id) {
114-
$array = $mappedUsers[$id->user_id]->identities;
115-
$array[] = $id;
114+
foreach ($identities as $identity) {
115+
$userId = $identity->user_id;
116116

117-
$mappedUsers[$id->user_id]->identities = $array;
117+
$newIdentities = $mappedUsers[$userId]->identities;
118+
$newIdentities[] = $identity;
119+
120+
$mappedUsers[$userId]->identities = $newIdentities;
118121
}
119122

120123
return $mappedUsers;

0 commit comments

Comments
 (0)