Closed
Description
Configuration
- PhpFastCache version: 9.1
- PhpFastCache API version: 4.1.0
- PHP version: 8.1
- Operating system: win10
Describe the bug
When updating cache item like this:
$item = $cacheItemPool->getItem('key');
$item->set('some data');
$item->setExpirationDate(new DateTimeImmutable('+1 year'));
$cacheItemPool->save($item);
(which is valid as setExpirationDate
allows DateTimeInterface
)
phpfastcache fails on reading data:
TypeError: DateTime::createFromFormat(): Argument #2 ($datetime) must be of type string, DateTimeImmutable given
in \Phpfastcache\Core\Pool\DriverBaseTrait::driverUnwrapEdate
Expected behavior
No error when expiration date set to DateTimeImmutable