public function __construct(array $segments = array(), $base_url = '', $config = array())
{
if (!is_string($base_url)) {
throw new \InvalidArgumentException('Base URL should be a string!');
}
$this->config = $config instanceof Config ? $config : new Config($config);
$this->segments = $segments;
$this->base_url = $base_url;
}