Skip to content

Commit 297fda5

Browse files
committed
fix phpstan level 2
1 parent 66aa9f2 commit 297fda5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Cache/Generator/HeaderCacheKeyGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
{

src/CachePlugin.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)