src/Stats.php
private function fetch($account_id) {
        if (!$account_id) return null;

        $data = FortniteClient::sendFortniteGetRequest(FortniteClient::FORTNITE_API . 'stats/accountId/' . $account_id . '/bulk/window/alltime',
                                                     $this->access_token);

        // Remove - from account ID and get it's display name
        $this->display_name = Account::getDisplayNameFromID(str_replace("-","",$this->account_id), $this->access_token);
        //if (!count($data)) throw new StatsNotFoundException('Unable to find any stats for account id '. $account_id);

        // Loop over all the stat objects and compile them together cleanly
        $compiledStats = [];
        foreach ($data as $stat) {
            $parsed = $this->parseStatItem($stat);
            $compiledStats = array_merge_recursive($compiledStats, $parsed);
        }

        // Now loop over the compiled stats and create proper objects
        $platforms = [];
        foreach ($compiledStats as $key => $platform) {
            $platforms[$key] = new Platform($platform);
        }

        return $platforms;
    }
private function fetch($account_id) {
        if (!$account_id) return null;

        $data = FortniteClient::sendFortniteGetRequest(FortniteClient::FORTNITE_API . 'stats/accountId/' . $account_id . '/bulk/window/alltime',
                                                     $this->access_token);

        // Remove - from account ID and get it's display name
        $this->display_name = Account::getDisplayNameFromID(str_replace("-","",$this->account_id), $this->access_token);
        //if (!count($data)) throw new StatsNotFoundException('Unable to find any stats for account id '. $account_id);

        // Loop over all the stat objects and compile them together cleanly
        $compiledStats = [];
        foreach ($data as $stat) {
            $parsed = $this->parseStatItem($stat);
            $compiledStats = array_merge_recursive($compiledStats, $parsed);
        }

        // Now loop over the compiled stats and create proper objects
        $platforms = [];
        foreach ($compiledStats as $key => $platform) {
            $platforms[$key] = new Platform($platform);
        }

        return $platforms;
    }
Fetches stats for the current user.
@param  string $account_id   Account id
@return object               The stats data