Test Failed
Push — drivers ( 4bb5a4...c650c9 )
by Joe
08:01
created

CacheProvider::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace PhpWinTools\WmiScripting\Support\Cache;
4
5
use Psr\SimpleCache\CacheInterface;
6
use PhpWinTools\WmiScripting\Configuration\Config;
7
8
class CacheProvider implements CacheInterface
9
{
10
    protected $config;
11
12
    /** @var CacheDriver */
13
    protected $cacheDriver;
14
15
    public function __construct(Config $config = null, CacheDriver $cacheDriver = null)
16
    {
17
        $this->config = $config ?? Config::instance();
18
19
        $this->cacheDriver = $cacheDriver ?? $this->config->getCacheDriver();
20
    }
21
22
    public function get($key, $default = null)
23
    {
24
        return $this->cacheDriver->get($key, $default);
25
    }
26
27
    public function set($key, $value, $ttl = null)
28
    {
29
        return $this->cacheDriver->set($key, $value, $ttl);
30
    }
31
32
    public function delete($key)
33
    {
34
        return $this->cacheDriver->delete($key);
35
    }
36
37
    public function clear()
38
    {
39
        return $this->cacheDriver->clear();
40
    }
41
42
    public function getMultiple($keys, $default = null)
43
    {
44
        return $this->cacheDriver->getMultiple($keys, $default);
45
    }
46
47
    public function setMultiple($values, $ttl = null)
48
    {
49
        return $this->cacheDriver->setMultiple($values, $ttl);
50
    }
51
52
    public function deleteMultiple($keys)
53
    {
54
        return $this->cacheDriver->deleteMultiple($keys);
55
    }
56
57
    public function has($key)
58
    {
59
        return $this->cacheDriver->has($key);
60
    }
61
}
62