From cefa1e6e82772d12041579005669644aa5b8227a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 7 May 2020 11:49:45 +0200 Subject: [PATCH] [Cache] fix accepting sub-second max-lifetimes in ArrayAdapter --- src/Symfony/Component/Cache/Adapter/ArrayAdapter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php b/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php index 6713da1f2a18..71d3e765bee9 100644 --- a/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/ArrayAdapter.php @@ -40,10 +40,10 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter /** * @param bool $storeSerialized Disabling serialization can lead to cache corruptions when storing mutable values but increases performance otherwise */ - public function __construct(int $defaultLifetime = 0, bool $storeSerialized = true, int $maxLifetime = 0, int $maxItems = 0) + public function __construct(int $defaultLifetime = 0, bool $storeSerialized = true, float $maxLifetime = 0, int $maxItems = 0) { if (0 > $maxLifetime) { - throw new InvalidArgumentException(sprintf('Argument $maxLifetime must be a positive integer, %d passed.', $maxLifetime)); + throw new InvalidArgumentException(sprintf('Argument $maxLifetime must be positive, %F passed.', $maxLifetime)); } if (0 > $maxItems) {