Skip to content

Commit 7341c6d

Browse files
committed
downgrade psr cache for compatibility (force-push to trigger actions)
1 parent 5a98f72 commit 7341c6d

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"require-dev": {
3434
"phpunit/phpunit": "^7.5||9.5",
35-
"psr/cache": "^3.0",
35+
"psr/cache": "^1.0|^2.0",
3636
"guzzlehttp/guzzle": "^7.4",
3737
"phpspec/prophecy-phpunit": "^2.0"
3838
}

tests/CachedKeySetTest.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ final class TestMemoryCacheItemPool implements CacheItemPoolInterface
305305
private $items;
306306
private $deferredItems;
307307

308-
public function getItem(string $key): CacheItemInterface
308+
public function getItem($key): CacheItemInterface
309309
{
310310
return current($this->getItems([$key]));
311311
}
@@ -321,7 +321,7 @@ public function getItems(array $keys = []): iterable
321321
return $items;
322322
}
323323

324-
public function hasItem(string $key): bool
324+
public function hasItem($key): bool
325325
{
326326
return isset($this->items[$key]) && $this->items[$key]->isHit();
327327
}
@@ -334,7 +334,7 @@ public function clear(): bool
334334
return true;
335335
}
336336

337-
public function deleteItem(string $key): bool
337+
public function deleteItem($key): bool
338338
{
339339
return $this->deleteItems([$key]);
340340
}
@@ -379,12 +379,14 @@ public function commit(): bool
379379
*/
380380
final class TestMemoryCacheItem implements CacheItemInterface
381381
{
382+
private $key;
382383
private $value;
383384
private $expiration;
384385
private $isHit = false;
385386

386-
public function __construct(private string $key)
387+
public function __construct(string $key)
387388
{
389+
$this->key = $key;
388390
}
389391

390392
public function getKey(): string
@@ -410,21 +412,21 @@ public function isHit(): bool
410412
return $this->currentTime()->getTimestamp() < $this->expiration->getTimestamp();
411413
}
412414

413-
public function set(mixed $value): static
415+
public function set($value)
414416
{
415417
$this->isHit = true;
416418
$this->value = $value;
417419

418420
return $this;
419421
}
420422

421-
public function expiresAt(?\DateTimeInterface $expiration): static
423+
public function expiresAt($expiration)
422424
{
423425
$this->expiration = $expiration;
424426
return $this;
425427
}
426428

427-
public function expiresAfter(\DateInterval|int|null $time): static
429+
public function expiresAfter($time)
428430
{
429431
$this->expiration = $this->currentTime()->add(new \DateInterval("PT{$time}S"));
430432
return $this;

0 commit comments

Comments
 (0)