Passed
Pull Request — master (#119)
by
unknown
06:28
created
src/CacheMiddleware.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  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
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                 $this->cacheStorage->delete($request);
119 119
 
120 120
                 return $handler($request, $options)->then(
121
-                    function (ResponseInterface $response) {
121
+                    function(ResponseInterface $response) {
122 122
                         return $response->withHeader(self::HEADER_CACHE_INFO, self::HEADER_CACHE_MISS);
123 123
                     }
124 124
                 );
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             $promise = $handler($request, $options);
188 188
 
189 189
             return $promise->then(
190
-                function (ResponseInterface $response) use ($request, $cacheEntry) {
190
+                function(ResponseInterface $response) use ($request, $cacheEntry) {
191 191
                     // Check if error and looking for a staled content
192 192
                     if ($response->getStatusCode() >= 500) {
193 193
                         $responseStale = static::getStaleResponse($cacheEntry);
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
                     return static::addToCache($this->cacheStorage, $request, $response, $update);
226 226
                 },
227
-                function ($reason) use ($cacheEntry) {
227
+                function($reason) use ($cacheEntry) {
228 228
                     if ($reason instanceof TransferException) {
229 229
                         $response = static::getStaleResponse($cacheEntry);
230 230
                         if ($response instanceof ResponseInterface) {
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             $request = $request->withHeader(self::HEADER_RE_VALIDATION, '1');
286 286
             $this->waitingRevalidate[] = $this->client
287 287
                 ->sendAsync($request)
288
-                ->then(function (ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) {
288
+                ->then(function(ResponseInterface $response) use ($request, &$cacheStorage, $cacheEntry) {
289 289
                     $update = false;
290 290
 
291 291
                     if ($response->getStatusCode() == 304) {
Please login to merge, or discard this patch.