1 | <?php |
||
16 | class Container |
||
17 | { |
||
18 | /** |
||
19 | * Contains the values (either input or output). |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $values = []; |
||
24 | |||
25 | /** |
||
26 | * Construct the Value\Container. |
||
27 | * |
||
28 | * @param array $values |
||
29 | */ |
||
30 | 154 | public function __construct(array $values = []) |
|
34 | |||
35 | /** |
||
36 | * Determines whether or not the container has a value for key $key. |
||
37 | * |
||
38 | * @param string $key |
||
39 | * @return bool |
||
40 | */ |
||
41 | 150 | public function has($key) |
|
45 | |||
46 | /** |
||
47 | * Returns the value for the key $key, or null if the value doesn't exist. |
||
48 | * |
||
49 | * @param string $key |
||
50 | * @return mixed |
||
51 | */ |
||
52 | 139 | public function get($key) |
|
56 | |||
57 | |||
58 | /** |
||
59 | * Removes a value from the container |
||
60 | * |
||
61 | * @param string $key |
||
62 | */ |
||
63 | 5 | public function remove($key) |
|
67 | |||
68 | /** |
||
69 | * Set the value of $key to $value. |
||
70 | * |
||
71 | * @param string $key |
||
72 | * @param mixed $value |
||
73 | * @return $this |
||
74 | */ |
||
75 | 146 | public function set($key, $value) |
|
83 | |||
84 | /** |
||
85 | * Returns a plain array representation of the Value\Container object. |
||
86 | * |
||
87 | * @return array |
||
88 | */ |
||
89 | 154 | public function getArrayCopy() |
|
93 | |||
94 | /** |
||
95 | * Traverses the key using dot notation. Based on the second parameter, it will return the value or if it was set. |
||
96 | * |
||
97 | * @param string $key |
||
98 | * @param bool $returnValue |
||
99 | * @return mixed |
||
100 | */ |
||
101 | 150 | protected function traverse($key, $returnValue = true) |
|
112 | |||
113 | /** |
||
114 | * Uses dot-notation to set a value. |
||
115 | * |
||
116 | * @param string $key |
||
117 | * @param mixed $value |
||
118 | * @return $this |
||
119 | */ |
||
120 | 4 | protected function setTraverse($key, $value) |
|
132 | } |
||
133 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.