File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ class HeaderCacheKeyGenerator implements CacheKeyGenerator
1414 /**
1515 * The header names we should take into account when creating the cache key.
1616 *
17- * @var array
17+ * @var string[]
1818 */
1919 private $ headerNames ;
2020
2121 /**
22- * @param $headerNames
22+ * @param string[] $headerNames
2323 */
2424 public function __construct (array $ headerNames )
2525 {
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ private function getMaxAge(ResponseInterface $response)
333333 if (!is_bool ($ maxAge )) {
334334 $ ageHeaders = $ response ->getHeader ('Age ' );
335335 foreach ($ ageHeaders as $ age ) {
336- return $ maxAge - ((int ) $ age );
336+ return (( int ) $ maxAge) - ((int ) $ age );
337337 }
338338
339339 return (int ) $ maxAge ;
@@ -449,14 +449,16 @@ private function getETag(CacheItemInterface $cacheItem)
449449 $ data = $ cacheItem ->get ();
450450 // The isset() is to be removed in 2.0.
451451 if (!isset ($ data ['etag ' ])) {
452- return ;
452+ return null ;
453453 }
454454
455455 foreach ($ data ['etag ' ] as $ etag ) {
456456 if (!empty ($ etag )) {
457457 return $ etag ;
458458 }
459459 }
460+
461+ return null ;
460462 }
461463
462464 /**
You can’t perform that action at this time.
0 commit comments