@@ -305,7 +305,7 @@ final class TestMemoryCacheItemPool implements CacheItemPoolInterface
305
305
private $ items ;
306
306
private $ deferredItems ;
307
307
308
- public function getItem (string $ key ): CacheItemInterface
308
+ public function getItem ($ key ): CacheItemInterface
309
309
{
310
310
return current ($ this ->getItems ([$ key ]));
311
311
}
@@ -321,7 +321,7 @@ public function getItems(array $keys = []): iterable
321
321
return $ items ;
322
322
}
323
323
324
- public function hasItem (string $ key ): bool
324
+ public function hasItem ($ key ): bool
325
325
{
326
326
return isset ($ this ->items [$ key ]) && $ this ->items [$ key ]->isHit ();
327
327
}
@@ -334,7 +334,7 @@ public function clear(): bool
334
334
return true ;
335
335
}
336
336
337
- public function deleteItem (string $ key ): bool
337
+ public function deleteItem ($ key ): bool
338
338
{
339
339
return $ this ->deleteItems ([$ key ]);
340
340
}
@@ -379,12 +379,14 @@ public function commit(): bool
379
379
*/
380
380
final class TestMemoryCacheItem implements CacheItemInterface
381
381
{
382
+ private $ key ;
382
383
private $ value ;
383
384
private $ expiration ;
384
385
private $ isHit = false ;
385
386
386
- public function __construct (private string $ key )
387
+ public function __construct (string $ key )
387
388
{
389
+ $ this ->key = $ key ;
388
390
}
389
391
390
392
public function getKey (): string
@@ -410,21 +412,21 @@ public function isHit(): bool
410
412
return $ this ->currentTime ()->getTimestamp () < $ this ->expiration ->getTimestamp ();
411
413
}
412
414
413
- public function set (mixed $ value ): static
415
+ public function set ($ value )
414
416
{
415
417
$ this ->isHit = true ;
416
418
$ this ->value = $ value ;
417
419
418
420
return $ this ;
419
421
}
420
422
421
- public function expiresAt (? \ DateTimeInterface $ expiration ): static
423
+ public function expiresAt ($ expiration )
422
424
{
423
425
$ this ->expiration = $ expiration ;
424
426
return $ this ;
425
427
}
426
428
427
- public function expiresAfter (\ DateInterval | int | null $ time ): static
429
+ public function expiresAfter ($ time )
428
430
{
429
431
$ this ->expiration = $ this ->currentTime ()->add (new \DateInterval ("PT {$ time }S " ));
430
432
return $ this ;
0 commit comments