File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 44
55- Test with PHP 8.1 and 8.2
66- Made phpspec tests compatible with PSR-7 2.0 strict typing
7+ - Detect ` null ` and use 0 explicitly to calculate expiration
78
89## 1.7.5 - 2022-01-18
910
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ private function calculateCacheItemExpiresAfter(?int $maxAge): ?int
230230 return null ;
231231 }
232232
233- return $ this ->config ['cache_lifetime ' ] + $ maxAge ;
233+ return ( $ this ->config ['cache_lifetime ' ] ?: 0 ) + ( $ maxAge ?: 0 ) ;
234234 }
235235
236236 /**
@@ -368,7 +368,7 @@ private function configureOptions(OptionsResolver $resolver): void
368368 $ resolver ->setAllowedTypes ('default_ttl ' , ['int ' , 'null ' ]);
369369 $ resolver ->setAllowedTypes ('respect_cache_headers ' , ['bool ' , 'null ' ]);
370370 $ resolver ->setAllowedTypes ('methods ' , 'array ' );
371- $ resolver ->setAllowedTypes ('cache_key_generator ' , ['null ' , ' Http\Client\Common\Plugin\Cache\Generator\ CacheKeyGenerator' ]);
371+ $ resolver ->setAllowedTypes ('cache_key_generator ' , ['null ' , CacheKeyGenerator::class ]);
372372 $ resolver ->setAllowedTypes ('blacklisted_paths ' , 'array ' );
373373 $ resolver ->setAllowedValues ('hash_algo ' , hash_algos ());
374374 $ resolver ->setAllowedValues ('methods ' , function ($ value ) {
You can’t perform that action at this time.
0 commit comments