ScriptFUSION\Porter\Cache\MemoryCache::deleteItems PHP Method

deleteItems() public method

public deleteItems ( array $keys )
$keys array
    public function deleteItems(array $keys)
    {
        foreach ($keys as $key) {
            if (!$this->hasItem($key)) {
                throw new InvalidArgumentException("No such key in cache: \"{$key}\".");
            }
            $this->deleteItem($key);
        }
    }

Usage Example

Example #1
0
 public function testDeleteInvalidItem()
 {
     $this->setExpectedException(InvalidArgumentException::class);
     $this->cache->deleteItems(['foo', 'bar']);
 }