Passed
Push — master ( fda11c...22d79b )
by Kevin
01:15 queued 12s
created
src/CacheMiddleware.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                     if ($reason instanceof TransferException) {
241 241
                         $response = static::getStaleResponse($cacheEntry);
242 242
                         if ($response instanceof ResponseInterface) {
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
             $request = $request->withHeader(self::HEADER_RE_VALIDATION, '1');
298 298
             $this->waitingRevalidate[] = $this->client
299 299
                 ->sendAsync($request)
300
-                ->then(function (ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) {
300
+                ->then(function(ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) {
301 301
                     $update = false;
302 302
 
303 303
                     if ($response->getStatusCode() == 304) {
Please login to merge, or discard this patch.