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

@@ -18,24 +18,18 @@ interface SurrogateInterface
{
/**
* Returns surrogate name.
*
* @return string
*/
public function getName();
public function getName(): string;
/**
* Returns a new cache strategy instance.
*
* @return ResponseCacheStrategyInterface
*/
public function createCacheStrategy();
public function createCacheStrategy(): ResponseCacheStrategyInterface;
/**
* Checks that at least one surrogate has Surrogate capability.
*
* @return bool
*/
public function hasSurrogateCapability(Request $request);
public function hasSurrogateCapability(Request $request): bool;
/**
* Adds Surrogate-capability to the given Request.
@@ -51,37 +45,29 @@ interface SurrogateInterface
/**
* Checks that the Response needs to be parsed for Surrogate tags.
*
* @return bool
*/
public function needsParsing(Response $response);
public function needsParsing(Response $response): bool;
/**
* Renders a Surrogate tag.
*
* @param string $alt An alternate URI
* @param string $comment A comment to add as an esi:include tag
*
* @return string
*/
public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = '');
public function renderIncludeTag(string $uri, string $alt = null, bool $ignoreErrors = true, string $comment = ''): string;
/**
* Replaces a Response Surrogate tags with the included resource content.
*
* @return Response
*/
public function process(Request $request, Response $response);
public function process(Request $request, Response $response): Response;
/**
* Handles a Surrogate from the cache.
*
* @param string $alt An alternative URI
*
* @return string
*
* @throws \RuntimeException
* @throws \Exception
*/
public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors);
public function handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors): string;
}