Jyxo\Spl\ObjectCache::clear PHP Method

clear() public method

Clear the whole storage.
public clear ( ) : self
return self
    public function clear() : self
    {
        $this->storage = [];
        return $this;
    }

Usage Example

コード例 #1
0
ファイル: ObjectCacheTest.php プロジェクト: JerryCR/php-2
 /**
  * Tests unset().
  */
 public function testUnset()
 {
     // Nothing is saved
     $this->assertFalse(isset($this->cache->{self::CACHE_KEY}));
     // Save and check
     $this->saveObject();
     $this->assertTrue(isset($this->cache->{self::CACHE_KEY}));
     // Unset the object and check
     unset($this->cache->{self::CACHE_KEY});
     $this->assertFalse(isset($this->cache->{self::CACHE_KEY}));
     // Save and check again
     $this->saveObject();
     $this->assertTrue(isset($this->cache->{self::CACHE_KEY}));
     $this->cache->clear();
 }