File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,9 +76,7 @@ protected function driverWrite(CacheItemInterface $item): bool
7676 * Check for Cross-Driver type confusion
7777 */
7878 if ($ item instanceof Item) {
79- $ ttl = $ item ->getExpirationDate ()->getTimestamp () - time ();
80-
81- return (bool )apcu_store ($ item ->getKey (), $ this ->driverPreWrap ($ item ), ($ ttl > 0 ? $ ttl : 0 ));
79+ return (bool ) apcu_store ($ item ->getKey (), $ this ->driverPreWrap ($ item ), $ item ->getTtl ());
8280 }
8381
8482 throw new PhpfastcacheInvalidArgumentException ('Cross-Driver type confusion detected ' );
Original file line number Diff line number Diff line change @@ -369,9 +369,9 @@ public function runCRUDTests(ExtendedCacheItemPoolInterface $pool)
369369 $ this ->printInfoText ('Running CRUD tests on the following backend: ' . get_class ($ pool ));
370370 $ pool ->clear ();
371371
372- $ cacheKey = 'cache_key_ ' . bin2hex (random_bytes (12 ) . '_ ' . random_int (100 , 999 ));
372+ $ cacheKey = 'cache_key_ ' . bin2hex (random_bytes (8 ) . '_ ' . random_int (100 , 999 ));
373373 $ cacheValue = 'cache_data_ ' . random_int (1000 , 999999 );
374- $ cacheTag = 'cache_tag_ ' . bin2hex (random_bytes (12 ) . '_ ' . random_int (100 , 999 ));
374+ $ cacheTag = 'cache_tag_ ' . bin2hex (random_bytes (8 ) . '_ ' . random_int (100 , 999 ));
375375 $ cacheItem = $ pool ->getItem ($ cacheKey );
376376 $ this ->printInfoText ('Using cache key: ' . $ cacheKey );
377377
You can’t perform that action at this time.
0 commit comments