diff --git a/README.md b/README.md index 5e0a891..75085c2 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,4 @@ If you need help, [create an issue](https://github.com/pgrimaud/lametric-fortnit # More info -Based on [Fortnite Tracker](https://fortnitetracker.com) +Based on [fortniteapi.io](https://fortniteapi.io) diff --git a/src/Fortnite/Api.php b/src/Fortnite/Api.php index b04fbe9..eabaf3b 100644 --- a/src/Fortnite/Api.php +++ b/src/Fortnite/Api.php @@ -10,12 +10,6 @@ class Api { - const PLATFORMS = [ - 'PC' => 'pc', - 'Xbox1' => 'xbl', - 'PS4' => 'psn', - ]; - const MODS = [ 'solo', 'duo', @@ -72,7 +66,13 @@ public function fetchData(): array throw new InternalErrorException('Internal error'); } - $playerId = $data["account_id"]; + if (!isset($data['account_id'])) { + throw new MissingParameterException( + sprintf('Player %s not found', $this->validator->getParameters()['player']) + ); + } else { + $playerId = $data['account_id']; + } try { $endpoint = 'https://fortniteapi.io/v1/stats?account=' . $playerId;