src/Service/UserService.php
public function getWeeklyArtistChart(string $username, ?RangeFilter $filter = null): array
    {
        $query = null !== $filter ? $filter->getQuery('from', 'to') : [];
        $query = array_merge($query, [
            'user'     => $username,
        ]);

        $response = $this->client->unsignedCall('user.getWeeklyArtistChart', $query);

        if (!isset($response['weeklyartistchart']['artist'])) {
            return [];
        }

        return ApiHelper::mapList(
            static function ($data) {
                return Artist::fromApi($data);
            },
            $response['weeklyartistchart']['artist']
        );
    }
public function getWeeklyArtistChart(string $username, ?RangeFilter $filter = null): array
    {
        $query = null !== $filter ? $filter->getQuery('from', 'to') : [];
        $query = array_merge($query, [
            'user'     => $username,
        ]);

        $response = $this->client->unsignedCall('user.getWeeklyArtistChart', $query);

        if (!isset($response['weeklyartistchart']['artist'])) {
            return [];
        }

        return ApiHelper::mapList(
            static function ($data) {
                return Artist::fromApi($data);
            },
            $response['weeklyartistchart']['artist']
        );
    }
{@inheritdoc}