Total Complexity | 12 |
Total Lines | 83 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class StorageManager |
||
8 | { |
||
9 | /** |
||
10 | * @var ProviderInterface |
||
11 | */ |
||
12 | public $provider; |
||
13 | |||
14 | /** |
||
15 | * @param $provider |
||
16 | */ |
||
17 | public function setProvider(ProviderInterface $provider) |
||
18 | { |
||
19 | $this->provider = $provider; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param $key |
||
24 | * @return bool |
||
25 | */ |
||
26 | public function hasItem($key) |
||
27 | { |
||
28 | return ($this->provider->get($key) && $this->stillRestricted($key)) ? true : false; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param $key |
||
33 | * @return mixed |
||
34 | */ |
||
35 | public function getItem($key) |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @param $key |
||
42 | * @param null $value |
||
|
|||
43 | */ |
||
44 | public function setItem($key, $value = null) |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * @param $key |
||
52 | */ |
||
53 | public function removeItem($key) |
||
54 | { |
||
55 | $this->provider->remove($key); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @return int |
||
60 | */ |
||
61 | public function getItemsCount() |
||
62 | { |
||
63 | return $this->provider->getItemsCount(); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @return array |
||
68 | */ |
||
69 | public function fetchAllItems() |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * @param $key |
||
76 | * @return bool |
||
77 | */ |
||
78 | private function stillRestricted($key) |
||
90 | } |
||
91 | } |
||
92 |