Passed
Pull Request — master (#157)
by
unknown
01:03
created
src/Strategy/PrivateCacheStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
                 return new CacheEntry(
94 94
                     $request,
95 95
                     $response,
96
-                    new \DateTime('+'.(int) $cacheControl->get($key).'seconds')
96
+                    new \DateTime('+'.(int)$cacheControl->get($key).'seconds')
97 97
                 );
98 98
             }
99 99
         }
Please login to merge, or discard this patch.
src/CacheEntry.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
         if ($staleIfErrorTo === null && $values->has('stale-if-error')) {
78 78
             $this->staleIfErrorTo = (new \DateTime(
79
-                '@'.($this->staleAt->getTimestamp() + (int) $values->get('stale-if-error'))
79
+                '@'.($this->staleAt->getTimestamp() + (int)$values->get('stale-if-error'))
80 80
             ));
81 81
         } else {
82 82
             $this->staleIfErrorTo = $staleIfErrorTo;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
         if ($staleWhileRevalidateTo === null && $values->has('stale-while-revalidate')) {
86 86
             $this->staleWhileRevalidateTo = new \DateTime(
87
-                '@'.($this->staleAt->getTimestamp() + (int) $values->get('stale-while-revalidate'))
87
+                '@'.($this->staleAt->getTimestamp() + (int)$values->get('stale-while-revalidate'))
88 88
             );
89 89
         } else {
90 90
             $this->staleWhileRevalidateTo = $staleWhileRevalidateTo;
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         $ttl = max($ttl, $this->staleAt->getTimestamp() - time());
247 247
         
248 248
         // Don't return 0, it's reserved for infinite TTL
249
-        return $ttl !== 0 ? (int) $ttl : -1;
249
+        return $ttl !== 0 ? (int)$ttl : -1;
250 250
     }
251 251
 
252 252
     /**
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     {
262 262
         // Stream/Resource can't be serialized... So we copy the content
263 263
         if ($this->response !== null) {
264
-            $this->responseBody = (string) $this->response->getBody();
264
+            $this->responseBody = (string)$this->response->getBody();
265 265
             $this->response->getBody()->rewind();
266 266
         }
267 267
 
Please login to merge, or discard this patch.
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.