public function listRepositories(string $sort = AbstractApi::SORT_CREATED,
                                     string $direction = AbstractApi::DIRECTION_DESC, string $username = null): array
    {
        if (null !== $username) {
            return $this->getApi()->request($this->getApi()->sprintf('/users/:username/starred?:args', $username,
                http_build_query(['sort' => $sort, 'direction' => $direction])));
        }

        return $this->getApi()->request($this->getApi()->sprintf('/user/starred?:args',
            http_build_query(['sort' => $sort, 'direction' => $direction])));
    }