Test Setup Failed
Pull Request — master (#89)
by Damian
03:54
created
src/CacheMiddleware.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function __invoke(callable $handler)
112 112
     {
113
-        return function (RequestInterface $request, array $options) use (&$handler) {
113
+        return function(RequestInterface $request, array $options) use (&$handler) {
114 114
             if (!isset($this->httpMethods[strtoupper($request->getMethod())])) {
115 115
                 // No caching for this method allowed
116 116
                 return $handler($request, $options)->then(
117
-                    function (ResponseInterface $response) {
117
+                    function(ResponseInterface $response) {
118 118
                         return $response->withHeader(self::HEADER_CACHE_INFO, self::HEADER_CACHE_MISS);
119 119
                     }
120 120
                 );
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
             $promise = $handler($request, $options);
184 184
 
185 185
             return $promise->then(
186
-                function (ResponseInterface $response) use ($request, $cacheEntry) {
186
+                function(ResponseInterface $response) use ($request, $cacheEntry) {
187 187
                     // Check if error and looking for a staled content
188 188
                     if ($response->getStatusCode() >= 500) {
189 189
                         $responseStale = static::getStaleResponse($cacheEntry);
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 
221 221
                     return static::addToCache($this->cacheStorage, $request, $response, $update);
222 222
                 },
223
-                function ($reason) use ($cacheEntry) {
223
+                function($reason) use ($cacheEntry) {
224 224
                     if ($reason instanceof TransferException) {
225 225
                         $response = static::getStaleResponse($cacheEntry);
226 226
                         if ($response instanceof ResponseInterface) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      */
273 273
     protected function addReValidationRequest(
274 274
         RequestInterface $request,
275
-        CacheStrategyInterface &$cacheStorage,
275
+        CacheStrategyInterface & $cacheStorage,
276 276
         CacheEntry $cacheEntry
277 277
     ) {
278 278
         // Add the promise for revalidate
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
             $request = $request->withHeader(self::HEADER_RE_VALIDATION, '1');
282 282
             $this->waitingRevalidate[] = $this->client
283 283
                 ->sendAsync($request)
284
-                ->then(function (ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) {
284
+                ->then(function(ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) {
285 285
                     $update = false;
286 286
 
287 287
                     if ($response->getStatusCode() == 304) {
Please login to merge, or discard this patch.