Nav apraksta

PSRCacheItem.php 1010B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace MailPoet\Doctrine;
  3. if (!defined('ABSPATH')) exit;
  4. use MailPoetVendor\Psr\Cache\CacheItemInterface;
  5. class PSRCacheItem implements CacheItemInterface {
  6. /** @var string */
  7. private $key;
  8. /** @var mixed */
  9. private $value;
  10. /** @var bool */
  11. private $isHit;
  12. public function __construct(string $key, bool $isHit) {
  13. $this->key = $key;
  14. $this->isHit = $isHit;
  15. }
  16. /**
  17. * @inheritDoc
  18. */
  19. public function getKey(): string {
  20. return $this->key;
  21. }
  22. /**
  23. * @inheritDoc
  24. */
  25. public function get() {
  26. return $this->value;
  27. }
  28. /**
  29. * @inheritDoc
  30. */
  31. public function isHit(): bool {
  32. // TODO: Implement isHit() method.
  33. return $this->isHit;
  34. }
  35. /**
  36. * @inheritDoc
  37. */
  38. public function set($value) {
  39. $this->value = $value;
  40. return $this;
  41. }
  42. /**
  43. * @inheritDoc
  44. */
  45. public function expiresAt($expiration) {
  46. return $this;
  47. }
  48. /**
  49. * @inheritDoc
  50. */
  51. public function expiresAfter($time) {
  52. return $this;
  53. }
  54. }