mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
#276: если система скинов недоступна, то генерируем ответ самостоятельно
This commit is contained in:
@@ -8,21 +8,26 @@ class Api {
|
||||
|
||||
const BASE_DOMAIN = 'http://skinsystem.ely.by';
|
||||
|
||||
public function textures($username) : array {
|
||||
/**
|
||||
* @param string $username
|
||||
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function textures(string $username): array {
|
||||
$response = $this->getClient()->get($this->getBuildUrl('/textures/' . $username));
|
||||
$textures = json_decode($response->getBody(), true);
|
||||
|
||||
return $textures;
|
||||
return json_decode($response->getBody(), true);
|
||||
}
|
||||
|
||||
protected function getBuildUrl(string $url) : string {
|
||||
protected function getBuildUrl(string $url): string {
|
||||
return self::BASE_DOMAIN . $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return GuzzleClient
|
||||
*/
|
||||
protected function getClient() : GuzzleClient {
|
||||
protected function getClient(): GuzzleClient {
|
||||
return Yii::$app->guzzle;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user