Skip to content

Commit

Permalink
fix: improving data array validation
Browse files Browse the repository at this point in the history
  • Loading branch information
yzPeedro committed May 1, 2022
1 parent d0d891a commit 67ecb88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Stats/StatsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class StatsApi
public function __construct(Authentication $authentication, array $data)
{
$this->auth = $authentication;

$data['platform'] = (! array_key_exists('platform', $data)) ? 'pc' : $data['platform'];
$data['username'] = (! array_key_exists('username', $data)) ? '' : $data['username'];
$data['statistic_type'] = (! isset($data['statistic_type'])) ? 'generic': $data['statistic_type'];
$data['region'] = (! isset($data['region'])) ? 'all' : $data['region'];
$this->data = $data;
Expand Down

0 comments on commit 67ecb88

Please sign in to comment.