package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 deletions

View File

@@ -40,18 +40,13 @@ abstract class AbstractSurrogate implements SurrogateInterface
/**
* Returns a new cache strategy instance.
*
* @return ResponseCacheStrategyInterface
*/
public function createCacheStrategy()
public function createCacheStrategy(): ResponseCacheStrategyInterface
{
return new ResponseCacheStrategy();
}
/**
* {@inheritdoc}
*/
public function hasSurrogateCapability(Request $request)
public function hasSurrogateCapability(Request $request): bool
{
if (null === $value = $request->headers->get('Surrogate-Capability')) {
return false;
@@ -60,9 +55,6 @@ abstract class AbstractSurrogate implements SurrogateInterface
return str_contains($value, sprintf('%s/1.0', strtoupper($this->getName())));
}
/**
* {@inheritdoc}
*/
public function addSurrogateCapability(Request $request)
{
$current = $request->headers->get('Surrogate-Capability');
@@ -71,10 +63,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
$request->headers->set('Surrogate-Capability', $current ? $current.', '.$new : $new);
}
/**
* {@inheritdoc}
*/
public function needsParsing(Response $response)
public function needsParsing(Response $response): bool
{
if (!$control = $response->headers->get('Surrogate-Control')) {
return false;
@@ -85,10 +74,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
return (bool) preg_match($pattern, $control);
}
/**
* {@inheritdoc}
*/
public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors)
public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors): string
{
$subRequest = Request::create($uri, Request::METHOD_GET, [], $cache->getRequest()->cookies->all(), [], $cache->getRequest()->server->all());