This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace PEIP\Data; |
||
4 | |||
5 | /* |
||
6 | * This file is part of the PEIP package. |
||
7 | * (c) 2009-2016 Timo Michna <timomichna/yahoo.de> |
||
8 | * |
||
9 | * For the full copyright and license information, please view the LICENSE |
||
10 | * file that was distributed with this source code. |
||
11 | */ |
||
12 | |||
13 | /** |
||
14 | * ParameterHolderCollection. |
||
15 | * |
||
16 | * @author Timo Michna <timomichna/yahoo.de> |
||
17 | * @implements \PEIP\INF\Data\ParameterHolderCollection |
||
18 | */ |
||
19 | class ParameterHolderCollection implements \PEIP\INF\Data\ParameterHolderCollection |
||
20 | { |
||
21 | protected $factory; |
||
22 | |||
23 | protected $stores; |
||
24 | |||
25 | /** |
||
26 | * @param $factory |
||
27 | * |
||
28 | * @return |
||
29 | */ |
||
30 | public function __construct(\PEIP\INF\Factory\DedicatedFactory $factory) |
||
31 | { |
||
32 | $this->factory = $factory; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param $namespace |
||
37 | * |
||
38 | * @return |
||
39 | */ |
||
40 | protected function getParameterHolderOrCreate($namespace) |
||
41 | { |
||
42 | if (!$this->hasParameterHolder($namespace)) { |
||
43 | $store = $this->factory->build(); |
||
44 | if ($store instanceof \PEIP\INF\Data\ParameterHolder) { |
||
45 | $this->stores[$namespace] = $store; |
||
46 | } else { |
||
47 | throw new \Exception('Could not build Instance of \PEIP\INF\Data\ParameterHolder from factory.'); |
||
48 | } |
||
49 | } |
||
50 | |||
51 | return $this->stores[$namespace]; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @param $namespace |
||
56 | * @param $parameters |
||
57 | * |
||
58 | * @return |
||
59 | */ |
||
60 | |||
61 | /** |
||
62 | * @param $namespace |
||
63 | * @param $name |
||
64 | * @param $value |
||
65 | * |
||
66 | * @return |
||
67 | */ |
||
68 | public function setParameters($namespace, array $parameters) |
||
69 | { |
||
70 | $this->getParameterHolderOrCreate($namespace)->setParameters($parameters); |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * @param $namespace |
||
75 | * @param $parameters |
||
76 | * |
||
77 | * @return |
||
78 | */ |
||
79 | public function addParameters($namespace, array $parameters) |
||
80 | { |
||
81 | $this->getParameterHolderOrCreate($namespace)->addParameters($parameters); |
||
82 | } |
||
83 | |||
84 | /** |
||
85 | * @param $namespace |
||
86 | * |
||
87 | * @return |
||
88 | */ |
||
89 | |||
90 | /** |
||
91 | * @param $namespace |
||
92 | * @param $name |
||
93 | * |
||
94 | * @return |
||
95 | */ |
||
96 | public function getParameters($namespace) |
||
97 | { |
||
98 | $this->getParameterHolderOrCreate($namespace)->getParameters(); |
||
99 | } |
||
100 | |||
101 | /** |
||
102 | * @param $namespace |
||
103 | * @param $name |
||
104 | * |
||
105 | * @return |
||
106 | */ |
||
107 | public function getParameter($namespace, $name) |
||
108 | { |
||
109 | $this->getParameterHolderOrCreate($namespace)->getParameter($name); |
||
110 | } |
||
111 | |||
112 | /** |
||
113 | * @param $namespace |
||
114 | * @param $name |
||
115 | * @param $value |
||
116 | * |
||
117 | * @return |
||
118 | */ |
||
119 | public function setParameter($namespace, $name, $value) |
||
120 | { |
||
121 | $this->getParameterHolderOrCreate($namespace)->setParameters($parameters); |
||
0 ignored issues
–
show
|
|||
122 | } |
||
123 | |||
124 | /** |
||
125 | * @param $namespace |
||
126 | * @param $name |
||
127 | * |
||
128 | * @return |
||
129 | */ |
||
130 | public function hasParameter($namespace, $name) |
||
131 | { |
||
132 | $this->getParameterHolderOrCreate($namespace)->hasParameter($name); |
||
133 | } |
||
134 | |||
135 | /** |
||
136 | * @param $namespace |
||
137 | * @param $name |
||
138 | * |
||
139 | * @return |
||
140 | */ |
||
141 | public function deleteParameter($namespace, $name) |
||
142 | { |
||
143 | $this->getParameterHolderOrCreate($namespace)->setParameters($parameters); |
||
0 ignored issues
–
show
|
|||
144 | } |
||
145 | |||
146 | /** |
||
147 | * @param $namespace |
||
148 | * @param $name |
||
149 | * @param $value |
||
150 | * |
||
151 | * @return |
||
152 | */ |
||
153 | |||
154 | /** |
||
155 | * @param $namespace |
||
156 | * @param $holder |
||
157 | * |
||
158 | * @return |
||
159 | */ |
||
160 | public function setParameterHolder($namespace, \PEIP\INF\Data\ParameterHolder $holder) |
||
161 | { |
||
162 | $this->stores[$namespace] = $holder; |
||
163 | } |
||
164 | |||
165 | /** |
||
166 | * @param $namespace |
||
167 | * @param $name |
||
168 | * |
||
169 | * @return |
||
170 | */ |
||
171 | |||
172 | /** |
||
173 | * @param $namespace |
||
174 | * |
||
175 | * @return |
||
176 | */ |
||
177 | public function getParameterHolder($namespace) |
||
178 | { |
||
179 | return $this->stores[$namespace]; |
||
180 | } |
||
181 | |||
182 | /** |
||
183 | * @param $namespace |
||
184 | * @param $name |
||
185 | * |
||
186 | * @return |
||
187 | */ |
||
188 | |||
189 | /** |
||
190 | * @param $namespace |
||
191 | * |
||
192 | * @return |
||
193 | */ |
||
194 | public function hasParameterHolder($namespace) |
||
195 | { |
||
196 | return array_key_exists($namespace, $this->stores); |
||
197 | } |
||
198 | |||
199 | /** |
||
200 | * @param $namespace |
||
201 | * @param $name |
||
202 | * |
||
203 | * @return |
||
204 | */ |
||
205 | |||
206 | /** |
||
207 | * @param $namespace |
||
208 | * |
||
209 | * @return |
||
210 | */ |
||
211 | public function deleteParameterHolder($namespace) |
||
212 | { |
||
213 | unset($this->stores[$namespace]); |
||
214 | } |
||
215 | } |
||
216 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.