/** * @test */ public function unserialize_sucessEmpty() { $input = new CacheEntry(); $target = new CacheEntry('example', ['example.file' => new DateTime()], new DateTime()); $target->unserialize($input->serialize()); $this->assertNull($target->getContent()); $this->assertNull($target->getFiles()); $this->assertNull($target->getLastModified()); }
private function requestCacheEntry($filePath) { if (isset($this->entries[$filePath])) { return $this->entries[$filePath]; } $content = $this->cache->getEntry($filePath); $entry = new CacheEntry(); $entry->unserialize($content); return $this->hasChanged($entry) ? $this->setCacheEntry($filePath) : ($this->entries[$filePath] = $entry); }
/** * @inheritdoc */ public function unserialize($serialized) { parent::unserialize($serialized); $this->transformContext(); return $this; }