public function store(Item $item) { $this->delete($item->getKey()); return file_put_contents($this->generateNewFilename($item), serialize($item)) !== false; }
public function testIsExpired() { $item = new Item('key'); $item->expiresAfter(10); $this->assertFalse($item->isExpired()); $item->expiresAfter(-10); $this->assertTrue($item->isExpired()); }
public function store(Item $item) { $this->data[$item->getKey()] = $item; return true; }