mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 08:03:49 +00:00
Refactor username mapping in activity context filter.
Replaced array_map with a foreach loop for clarity and maintainability when extracting usernames from work referrers. This ensures better readability and aligns with coding standards.
This commit is contained in:
@@ -143,7 +143,10 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
||||
array_filter(
|
||||
$works,
|
||||
function ($work) use ($user) {
|
||||
$workUsernames = array_map(static fn (User $user) => $user['username'], $work['referrers'] ?? []);
|
||||
$workUsernames = [];
|
||||
foreach ($work['referrers'] as $referrer) {
|
||||
$workUsernames[] = $referrer['username'];
|
||||
}
|
||||
|
||||
return \in_array($user->getUserIdentifier(), $workUsernames, true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user