App\Transformers\UserStatisticsTransformer::transform PHP Method

transform() public method

public transform ( Model $stats = null )
$stats App\Models\UserStatistics\Model
    public function transform(UserStatistics\Model $stats = null)
    {
        if ($stats === null) {
            $stats = new UserStatistics\Osu();
        }
        return ['rank' => ['isRanked' => $stats->rank_score_index > 0, 'global' => $stats->rank_score_index, 'country' => $stats->countryRank()], 'level' => ['current' => $stats->currentLevel(), 'progress' => $stats->currentLevelProgressPercent()], 'rankedScore' => $stats->ranked_score, 'hitAccuracy' => $stats->accuracy_new, 'playCount' => $stats->playcount, 'totalScore' => $stats->total_score, 'totalHits' => $stats->totalHits(), 'maximumCombo' => $stats->max_combo, 'replaysWatchedByOthers' => $stats->replay_popularity, 'scoreRanks' => ['X' => $stats->x_rank_count, 'S' => $stats->s_rank_count, 'A' => $stats->a_rank_count]];
    }
UserStatisticsTransformer