mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Added support of the onUnknownProfileRespondWithUuid when calling Chrly endpoint
This commit is contained in:
@@ -39,12 +39,17 @@ class SkinsSystemApi {
|
||||
* @return array|null
|
||||
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||
*/
|
||||
public function profile(string $username, bool $signed = false): ?array {
|
||||
$url = "/profile/{$username}";
|
||||
public function profile(string $username, bool $signed = false, ?string $fallbackUuid = null): ?array {
|
||||
$query = [];
|
||||
if ($signed) {
|
||||
$url .= '?unsigned=false';
|
||||
$query['unsigned'] = 'false';
|
||||
}
|
||||
|
||||
if ($fallbackUuid !== null) {
|
||||
$query['onUnknownProfileRespondWithUuid'] = $fallbackUuid;
|
||||
}
|
||||
|
||||
$url = "/profile/{$username}" . empty($query) ? '' : http_build_query($query);
|
||||
$response = $this->getClient()->request('GET', $this->buildUrl($url));
|
||||
if ($response->getStatusCode() !== 200) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user