Issues (150)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Data/ParameterHolderCollection.php (2 issues)

Labels
Severity

Upgrade to new PHP Analysis Engine

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
The variable $parameters does not exist. Did you forget to declare it?

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.

Loading history...
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
The variable $parameters does not exist. Did you forget to declare it?

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.

Loading history...
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