public function getRepositories($user = '', $sort = 'created', $direction = 'desc')
	{
		$allowedSort = array('created', 'updated');
		$allowedDir  = array('asc', 'desc');

		if (!\in_array($sort, $allowedSort))
		{
			throw new \InvalidArgumentException(
				sprintf(
					'The sorting value is invalid. Allowed values are: %s',
					implode(', ', $allowedSort)
				)
			);
		}

		if (!\in_array($direction, $allowedDir))
		{
			throw new \InvalidArgumentException(
				sprintf(
					'The direction value is invalid. Allowed values are: %s',
					implode(', ', $allowedDir)
				)
			);
		}

		// Build the request path.
		$path = ($user)
			? '/users' . $user . '/starred'
			: '/user/starred';

		$uri = new Uri($this->fetchUrl($path));
		$uri->setVar('sort', $sort);
		$uri->setVar('direction', $direction);

		// Send the request.
		return $this->processResponse($this->client->get($uri));
	}