Passed
Push — master ( e1430d...752221 )
by Kevin
02:57
created
src/CacheMiddleware.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public function __invoke(callable $handler)
113 113
     {
114
-        return function (RequestInterface $request, array $options) use (&$handler) {
114
+        return function(RequestInterface $request, array $options) use (&$handler) {
115 115
             if (!isset($this->httpMethods[strtoupper($request->getMethod())])) {
116 116
                 // No caching for this method allowed
117 117
 
118 118
                 return $handler($request, $options)->then(
119
-                    function (ResponseInterface $response) use ($request) {
119
+                    function(ResponseInterface $response) use ($request) {
120 120
                         // Invalidate cache after a call of non-safe method on the same URI
121 121
                         $response = $this->invalidateCache($request, $response);
122 122
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             $promise = $handler($request, $options);
189 189
 
190 190
             return $promise->then(
191
-                function (ResponseInterface $response) use ($request, $cacheEntry) {
191
+                function(ResponseInterface $response) use ($request, $cacheEntry) {
192 192
                     // Check if error and looking for a staled content
193 193
                     if ($response->getStatusCode() >= 500) {
194 194
                         $responseStale = static::getStaleResponse($cacheEntry);
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
                     return static::addToCache($this->cacheStorage, $request, $response, $update);
227 227
                 },
228
-                function ($reason) use ($cacheEntry) {
228
+                function($reason) use ($cacheEntry) {
229 229
                     if ($reason instanceof TransferException) {
230 230
                         $response = static::getStaleResponse($cacheEntry);
231 231
                         if ($response instanceof ResponseInterface) {
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             $request = $request->withHeader(self::HEADER_RE_VALIDATION, '1');
287 287
             $this->waitingRevalidate[] = $this->client
288 288
                 ->sendAsync($request)
289
-                ->then(function (ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) {
289
+                ->then(function(ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) {
290 290
                     $update = false;
291 291
 
292 292
                     if ($response->getStatusCode() == 304) {
Please login to merge, or discard this patch.