the browser-facing portion of osu!
at master 26 lines 803 B view raw
1<?php 2 3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4// See the LICENCE file in the repository root for full licence text. 5 6declare(strict_types=1); 7 8namespace App\Transformers; 9 10use App\Models\GithubUser; 11 12class GithubUserTransformer extends TransformerAbstract 13{ 14 public function transform(GithubUser $githubUser): array 15 { 16 return [ 17 'display_name' => $githubUser->displayUsername(), 18 'github_url' => $githubUser->githubUrl(), 19 'github_username' => $githubUser->username, 20 'id' => $githubUser->getKey(), 21 'osu_username' => $githubUser->user?->username, 22 'user_id' => $githubUser->user_id, 23 'user_url' => $githubUser->user?->url(), 24 ]; 25 } 26}