getClient()->request('GET', $this->buildUrl('/textures/' . $username)); if ($response->getStatusCode() !== 204) { return null; } return json_decode($response->getBody()->getContents(), true); } public function setClient(ClientInterface $client): void { $this->client = $client; } private function buildUrl(string $url): string { return self::BASE_DOMAIN . $url; } private function getClient(): ClientInterface { if ($this->client === null) { $this->client = Yii::$container->get(ClientInterface::class); } return $this->client; } }