public function format(Account $account, array $frontline) { $profiles = array_map(function (Profile $profile) { return $this->profileFormatter->format($profile); }, $account->getProfiles()->toArray()); return ["api_key" => $account->getAPIKey(), "account" => $account->toJSON(), "profiles" => $profiles, "frontline" => $frontline]; }
public function toJSON() : array { return ['account' => $this->account->toJSON(), 'apps' => ['admin' => $this->appAdmin, 'reports' => $this->appReports, 'feedback' => $this->appFeedback]]; }