@@ -120,12 +120,12 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function __invoke(callable $handler) |
| 122 | 122 | { |
| 123 | - return function (RequestInterface $request, array $options) use (&$handler) { |
|
| 123 | + return function(RequestInterface $request, array $options) use (&$handler) { |
|
| 124 | 124 | if (!isset($this->httpMethods[strtoupper($request->getMethod())])) { |
| 125 | 125 | // No caching for this method allowed |
| 126 | 126 | |
| 127 | 127 | return $handler($request, $options)->then( |
| 128 | - function (ResponseInterface $response) use ($request) { |
|
| 128 | + function(ResponseInterface $response) use ($request) { |
|
| 129 | 129 | if (!isset($this->safeMethods[$request->getMethod()])) { |
| 130 | 130 | // Invalidate cache after a call of non-safe method on the same URI |
| 131 | 131 | $response = $this->invalidateCache($request, $response); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $promise = $handler($request, $options); |
| 200 | 200 | |
| 201 | 201 | return $promise->then( |
| 202 | - function (ResponseInterface $response) use ($request, $cacheEntry) { |
|
| 202 | + function(ResponseInterface $response) use ($request, $cacheEntry) { |
|
| 203 | 203 | // Check if error and looking for a staled content |
| 204 | 204 | if ($response->getStatusCode() >= 500) { |
| 205 | 205 | $responseStale = static::getStaleResponse($cacheEntry); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | return static::addToCache($this->cacheStorage, $request, $response, $update); |
| 238 | 238 | }, |
| 239 | - function ($reason) use ($cacheEntry) { |
|
| 239 | + function($reason) use ($cacheEntry) { |
|
| 240 | 240 | $response = static::getStaleResponse($cacheEntry); |
| 241 | 241 | if ($response instanceof ResponseInterface) { |
| 242 | 242 | return $response; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | protected function addReValidationRequest( |
| 295 | 295 | RequestInterface $request, |
| 296 | - CacheStrategyInterface &$cacheStorage, |
|
| 296 | + CacheStrategyInterface & $cacheStorage, |
|
| 297 | 297 | CacheEntry $cacheEntry |
| 298 | 298 | ) { |
| 299 | 299 | // Add the promise for revalidate |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | $request = $request->withHeader(static::HEADER_RE_VALIDATION, '1'); |
| 303 | 303 | $this->waitingRevalidate[] = $this->client |
| 304 | 304 | ->sendAsync($request) |
| 305 | - ->then(function (ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) { |
|
| 305 | + ->then(function(ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) { |
|
| 306 | 306 | $update = false; |
| 307 | 307 | |
| 308 | 308 | if ($response->getStatusCode() == 304) { |