private HttpClientInterface
$client;
private HttpCache
$cache;
private array
$defaultOptions = self::OPTIONS_DEFAULTS;
public function __construct(HttpClientInterface
$client, StoreInterface
$store, array
$defaultOptions =
[]) { if (!
class_exists(HttpClientKernel::
class)) { throw new \
LogicException(sprintf('Using "%s" requires that the HttpKernel component version 4.3 or higher is installed, try running "composer require symfony/http-kernel:^5.4".', __CLASS__
));
} $this->client =
$client;
$kernel =
new HttpClientKernel($client);
$this->cache =
new HttpCache($kernel,
$store, null,
$defaultOptions);
unset($defaultOptions['debug'
]);
unset($defaultOptions['default_ttl'
]);
unset($defaultOptions['private_headers'
]);
unset($defaultOptions['skip_response_headers'
]);
unset($defaultOptions['allow_reload'
]);
unset($defaultOptions['allow_revalidate'
]);
unset($defaultOptions['stale_while_revalidate'
]);
unset($defaultOptions['stale_if_error'
]);
unset($defaultOptions['trace_level'
]);