mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-03 13:40:00 +09:00
Update to laravel 7
This commit is contained in:
@@ -41,7 +41,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
/**
|
||||
* Returns a new cache strategy instance.
|
||||
*
|
||||
* @return ResponseCacheStrategyInterface A ResponseCacheStrategyInterface instance
|
||||
* @return ResponseCacheStrategyInterface
|
||||
*/
|
||||
public function createCacheStrategy()
|
||||
{
|
||||
@@ -57,7 +57,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
return false !== strpos($value, sprintf('%s/1.0', strtoupper($this->getName())));
|
||||
return str_contains($value, sprintf('%s/1.0', strtoupper($this->getName())));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors)
|
||||
public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors)
|
||||
{
|
||||
$subRequest = Request::create($uri, Request::METHOD_GET, [], $cache->getRequest()->cookies->all(), [], $cache->getRequest()->server->all());
|
||||
|
||||
@@ -96,7 +96,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
$response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
|
||||
|
||||
if (!$response->isSuccessful()) {
|
||||
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $subRequest->getUri(), $response->getStatusCode()));
|
||||
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $subRequest->getUri(), $response->getStatusCode()));
|
||||
}
|
||||
|
||||
return $response->getContent();
|
||||
@@ -109,6 +109,8 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user