public function __construct($url, CacheItemPoolInterface $cache = null, $ttl = 86400, $allow_unsecured_connection = false, $allow_http_connection = false)
{
Assertion::boolean($allow_unsecured_connection);
Assertion::boolean($allow_http_connection);
Assertion::integer($ttl);
Assertion::min($ttl, 0);
Assertion::false(false === filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED), 'Invalid URL.');
$allowed_protocols = ['https'];
if (true === $allow_http_connection) {
$allowed_protocols[] = 'http';
}
Assertion::inArray(mb_substr($url, 0, mb_strpos($url, '://', 0, '8bit'), '8bit'), $allowed_protocols, sprintf('The provided sector identifier URI is not valid: scheme must be one of the following: %s.', json_encode($allowed_protocols)));
$this->url = $url;
$this->cache = $cache;
$this->ttl = $ttl;
$this->allow_unsecured_connection = $allow_unsecured_connection;
}