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