diff --git a/src/Api/User.php b/src/Api/User.php index bf1100b..68b409f 100644 --- a/src/Api/User.php +++ b/src/Api/User.php @@ -50,7 +50,7 @@ public function __construct(Client $client, $onlineIdOrProfileObject = '') /** * Gets online ID. * - * @return void + * @return string */ public function onlineId() : string { @@ -133,11 +133,11 @@ public function avatarUrl() : string } /** - * Gets the User psnuid. + * Gets the User accountId. * * @return string */ - public function psnuid() : string + public function accountId() : string { return $this->info()->accountId; } @@ -282,14 +282,7 @@ public function games($limit = 100) : array { $returnGames = []; - $games = $this->get(sprintf(Game::GAME_ENDPOINT . 'users/%s/titles', $this->onlineIdParameter()), [ - 'type' => 'played', - 'app' => 'richProfile', // ?? - 'sort' => '-lastPlayedDate', - 'limit' => $limit, - 'iw' => 240, // Size of game image width - 'ih' => 240 // Size of game image height - ]); + $games = $this->fetchPlayedGames($limit); if ($games->size === 0) return $returnGames; @@ -300,6 +293,22 @@ public function games($limit = 100) : array return $returnGames; } + /** + * @param int $limit + * @return + */ + public function fetchPlayedGames($limit) + { + return $this->get(sprintf(Game::GAME_ENDPOINT . 'users/%s/titles', $this->onlineIdParameter()), [ + 'type' => 'played', + 'app' => 'richProfile', // ?? + 'sort' => '-lastPlayedDate', + 'limit' => $limit, + 'iw' => 240, // Size of game image width + 'ih' => 240 // Size of game image height + ]); + } + /** * Send a Message to the User. *