EmbedKeyValueTrait   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A exists() 0 3 1
A set() 0 3 1
A delete() 0 3 1
A get() 0 3 1
A getInnerKeyValue() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lit\Nexus\Traits;
6
7
use Lit\Nexus\Interfaces\KeyValueInterface;
8
9
/**
10
 * KeyValueInterface implementation which delegating to $innerKeyValue
11
 */
12
trait EmbedKeyValueTrait
13
{
14
    /**
15
     * @var KeyValueInterface
16
     */
17
    protected $innerKeyValue;
18
19
    public function set(string $key, $value)
20
    {
21
        $this->innerKeyValue->set($key, $value);
22
    }
23
24
    public function delete(string $key)
25
    {
26
        $this->innerKeyValue->delete($key);
27
    }
28
29
    public function get(string $key)
30
    {
31
        return $this->innerKeyValue->get($key);
32
    }
33
34
    public function exists(string $key)
35
    {
36
        return $this->innerKeyValue->exists($key);
37
    }
38
39
    /**
40
     * @return KeyValueInterface
41
     */
42
    public function getInnerKeyValue()
43
    {
44
        return $this->innerKeyValue;
45
    }
46
}
47