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
14
14
/**
15
15
* The header names we should take into account when creating the cache key.
16
16
*
17
- * @var array
17
+ * @var string[]
18
18
*/
19
19
private $ headerNames ;
20
20
21
21
/**
22
- * @param $headerNames
22
+ * @param string[] $headerNames
23
23
*/
24
24
public function __construct (array $ headerNames )
25
25
{
Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ private function getMaxAge(ResponseInterface $response)
333
333
if (!is_bool ($ maxAge )) {
334
334
$ ageHeaders = $ response ->getHeader ('Age ' );
335
335
foreach ($ ageHeaders as $ age ) {
336
- return $ maxAge - ((int ) $ age );
336
+ return (( int ) $ maxAge) - ((int ) $ age );
337
337
}
338
338
339
339
return (int ) $ maxAge ;
@@ -449,14 +449,16 @@ private function getETag(CacheItemInterface $cacheItem)
449
449
$ data = $ cacheItem ->get ();
450
450
// The isset() is to be removed in 2.0.
451
451
if (!isset ($ data ['etag ' ])) {
452
- return ;
452
+ return null ;
453
453
}
454
454
455
455
foreach ($ data ['etag ' ] as $ etag ) {
456
456
if (!empty ($ etag )) {
457
457
return $ etag ;
458
458
}
459
459
}
460
+
461
+ return null ;
460
462
}
461
463
462
464
/**
You can’t perform that action at this time.
0 commit comments