LockerManager::update()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the LockerManager package.
4
 *
5
 * (c) Mauro Cassani<https://github.com/mauretto78>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace LockerManager\Application;
12
13
use LockerManager\Domain\Lock;
14
use LockerManager\Infrastructure\LockerStoreInterface;
15
16
class LockerManager
17
{
18
    /**
19
     * @var LockerStoreInterface
20
     */
21
    private $store;
22
23
    /**
24
     * LockerManager constructor.
25
     * @param LockerStoreInterface $store
26
     */
27
    public function __construct(LockerStoreInterface $store)
28
    {
29
        $this->store = $store;
30
    }
31
32
    /**
33
     * @param Lock $lock
34
     * @return mixed
35
     */
36
    public function acquire(Lock $lock)
37
    {
38
        return $this->store->acquire($lock);
39
    }
40
41
    /**
42
     * @return mixed
43
     */
44
    public function clear()
45
    {
46
        return $this->store->clear();
47
    }
48
49
    /**
50
     * @param $key
51
     * @return mixed
52
     */
53
    public function delete($key)
54
    {
55
        return $this->store->delete($key);
56
    }
57
58
    /**
59
     * @param $key
60
     * @return mixed
61
     */
62
    public function exists($key)
63
    {
64
        return $this->store->exists($key);
65
    }
66
67
    /**
68
     * @param $key
69
     * @return mixed
70
     */
71
    public function get($key)
72
    {
73
        return $this->store->get($key);
74
    }
75
76
    /**
77
     * @return mixed
78
     */
79
    public function getAll()
80
    {
81
        return $this->store->getAll();
82
    }
83
84
    /**
85
     * @param $key
86
     * @param $payload
87
     * @return mixed
88
     */
89
    public function update($key, $payload)
90
    {
91
        return $this->store->update($key, $payload);
92
    }
93
}
94