@@ -41,7 +41,7 @@ |
||
| 41 | 41 | * @param string $cacheKey |
| 42 | 42 | * @param int|\DateInterval $expiresAfter |
| 43 | 43 | * @param callable $callback |
| 44 | - * @return mixed |
|
| 44 | + * @return Response |
|
| 45 | 45 | * @throws PhpfastcacheLogicException |
| 46 | 46 | */ |
| 47 | 47 | public function getResponse(string $cacheKey, $expiresAfter = null, callable $callback): Response |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | $this->cacheInstance->save($cacheItem); |
| 71 | 71 | $cacheResponse = $response; |
| 72 | 72 | }else{ |
| 73 | - throw new PhpfastcacheLogicException('Your callback response MUST return a valid Symfony HTTP Foundation Response object'); |
|
| 73 | + throw new PhpfastcacheLogicException('Your callback response MUST return a valid Symfony HTTP Foundation Response object'); |
|
| 74 | 74 | } |
| 75 | 75 | }else{ |
| 76 | 76 | $cacheResponse->isNotModified($this->request); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | if (!($cacheResponse instanceof Response)) { |
| 59 | 59 | $response = $callback(); |
| 60 | - if($response instanceof Response){ |
|
| 60 | + if ($response instanceof Response) { |
|
| 61 | 61 | $cacheItem->expiresAfter($expiresAfter); |
| 62 | 62 | |
| 63 | 63 | $response->setExpires($cacheItem->getExpirationDate()); |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | $cacheItem->set($response); |
| 70 | 70 | $this->cacheInstance->save($cacheItem); |
| 71 | 71 | $cacheResponse = $response; |
| 72 | - }else{ |
|
| 72 | + } else { |
|
| 73 | 73 | throw new PhpfastcacheLogicException('Your callback response MUST return a valid Symfony HTTP Foundation Response object'); |
| 74 | 74 | } |
| 75 | - }else{ |
|
| 75 | + } else { |
|
| 76 | 76 | $cacheResponse->isNotModified($this->request); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -69,10 +69,10 @@ |
||
| 69 | 69 | $cacheItem->set($response); |
| 70 | 70 | $this->cacheInstance->save($cacheItem); |
| 71 | 71 | $cacheResponse = $response; |
| 72 | - }else{ |
|
| 72 | + } else{ |
|
| 73 | 73 | throw new PhpfastcacheLogicException('Your callback response MUST return a valid Symfony HTTP Foundation Response object'); |
| 74 | 74 | } |
| 75 | - }else{ |
|
| 75 | + } else{ |
|
| 76 | 76 | $cacheResponse->isNotModified($this->request); |
| 77 | 77 | } |
| 78 | 78 | |