Annotations
3 years ago
EntityTraits
2 years ago
EventListeners
2 months ago
Middlewares
4 weeks ago
Types
2 months ago
Validator
2 months ago
WPDB
2 months ago
ArrayCache.php
2 months ago
CacheOnlyMappingDriver.php
3 years ago
ConfigurationFactory.php
3 years ago
ConnectionFactory.php
1 year ago
EntityManagerFactory.php
2 years ago
MetadataCache.php
2 months ago
PSRArrayCache.php
2 months ago
PSRCacheInvalidArgumentException.php
3 years ago
PSRCacheItem.php
2 months ago
PSRMetadataCache.php
3 years ago
ProxyClassNameResolver.php
3 years ago
Repository.php
8 months ago
TablePrefixMetadataFactory.php
6 months ago
index.php
3 years ago
PSRCacheItem.php
72 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\Doctrine; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoetVendor\Psr\Cache\CacheItemInterface; |
| 9 | |
| 10 | class PSRCacheItem implements CacheItemInterface { |
| 11 | |
| 12 | /** @var string */ |
| 13 | private $key; |
| 14 | |
| 15 | /** @var mixed */ |
| 16 | private $value; |
| 17 | |
| 18 | /** @var bool */ |
| 19 | private $isHit; |
| 20 | |
| 21 | public function __construct( |
| 22 | string $key, |
| 23 | bool $isHit |
| 24 | ) { |
| 25 | $this->key = $key; |
| 26 | $this->isHit = $isHit; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * @inheritDoc |
| 31 | */ |
| 32 | public function getKey(): string { |
| 33 | return $this->key; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * @inheritDoc |
| 38 | */ |
| 39 | public function get() { |
| 40 | return $this->value; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * @inheritDoc |
| 45 | */ |
| 46 | public function isHit(): bool { |
| 47 | return $this->isHit; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @inheritDoc |
| 52 | */ |
| 53 | public function set($value) { |
| 54 | $this->value = $value; |
| 55 | return $this; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * @inheritDoc |
| 60 | */ |
| 61 | public function expiresAt($expiration) { |
| 62 | return $this; |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * @inheritDoc |
| 67 | */ |
| 68 | public function expiresAfter($time) { |
| 69 | return $this; |
| 70 | } |
| 71 | } |
| 72 |