public function __construct($uri, $params = [], $cache = null, $salvageable = true)
{
$this->uri = $uri;
if (is_bool($params)) {
$salvageable = $params;
$params = [];
} else {
if (!is_array($params)) {
$salvageable = $cache === null ? true : $cache;
$cache = $params;
$params = [];
}
}
$this->params = $params;
$this->cache = $cache;
// compile url with params
$query = array_merge(['lc' => 'en'], $this->params);
$this->url = $this->uri . '?' . http_build_query($query);
$this->key = 'bungie:platform:' . sha1($this->url);
$this->salvageable = $salvageable;
}