feat : add Serializer::users() for collaborators
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,19 @@ final class Serializer
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Collection<int, User> $users
|
||||||
|
*
|
||||||
|
* @return list<array{id: ?int, username: ?string}>
|
||||||
|
*/
|
||||||
|
public static function users(Collection $users): array
|
||||||
|
{
|
||||||
|
return $users->map(fn (User $u) => [
|
||||||
|
'id' => $u->getId(),
|
||||||
|
'username' => $u->getUsername(),
|
||||||
|
])->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return null|array{id: ?int, title: ?string, color: ?string}
|
* @return null|array{id: ?int, title: ?string, color: ?string}
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user