* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class Item implements CacheItemInterface { /** @var string */ protected $key; /** @var mixed */ protected $value; /** @var boolean */ protected $isHit; /** @var integer */ protected $ttl; public function __construct($key, $value, $isHit, $ttl = 0) { $this->key = $key; $this->value = $value; $this->isHit = $isHit; $this->ttl = $ttl; } public function getKey() { return $this->key; } public function get() { return $this->value; } public function isHit() { return $this->isHit; } public function set($value) { $this->value = $value; return $this; } /** * @inheritdoc */ public function expiresAt($expiration) { if (is_int($expiration)) { $this->ttl = $expiration - time(); } elseif ($expiration instanceof \DateTime) { $this->ttl = $expiration->getTimestamp() - time(); } elseif ($expiration === null) { $this->ttl = 0; } else { throw new Exception('Invalid expires at parameter'); } return $this; } public function expiresAfter($time) { if (is_int($time)) { $this->ttl = $time; } elseif ($time instanceof \DateInterval) { $now = new \DateTime(); $now->add($time); $this->ttl = $now->getTimestamp() - time(); } elseif ($time === null) { $this->ttl = 0; } else { throw new Exception('Invalid expires after parameter'); } return $this; } public function getTtl() { return $this->ttl; } } __halt_compiler();----SIGNATURE:----gSbZqU/3QsF3J8jjavVz+g9KLV3qUbspcUROdE0kt962Hr+dAWbFXQr8DA7d/BnacTYyktSfPkjUZGEzk6D7JeODLFJQZw2M6c3mqmJuGx1cjCGmhCIiQRitRLdL/VF4EwI5TeVSgtmnh2z6V7rSVlpGhiJDcjEykYKHGuCagZUflxM6n4M2cg0R9aiC+YkKsM6ciIc1wmOhQ+cDNRUj/Kjk7kg3hojbenPNm5Y4bmdugYSl6f1zEAnrOOiRGWs7P5KVtP7UPCI8qiAbt/Sg6gC3pczyLQwflyMFu4aaiLPzPHniosXSiSU7bkAqlQK1ob8nVmdmZxXkBWG/rm4JG4RBv1puoWKoZPHfEy5WlfMFmGs29gYAjhHQz3DJhvifs1alB/kZEH8P9BmXhEoCk3cJ9Cd9/8NUbGZL7l9lQwilr9FKYqvFB6h7SbLq0I+zal+He1iQRqp9GpSgEV+2QYnrlKrLy9Xdc36k2BEOWqVssifKV9rdyBUhIms/b7UuUMX1L4h9o+2fW3YjbojiCBObN0xb93EcLB7eZxRY0LBptTovO+ZkiNWqgwqqqe8MJzjdi5QmujFhD9Co8XbG4N010I+4YwL1n+6WCxfSaStnyID7sDzWoO0A+Hu0jNnfGYcrMLXCfAyBLtWFnWjxwOWDLRz0MWZxhkrW71wjEkQ=----ATTACHMENT:----NDI0OTQ2MjA3Mzg0MTEzNyA3NDYwNjU3ODM1NDgwODc5IDIyMDI0OTk0ODA0NDg5OTY=