Issues (17)

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.

lib/View/ViewConfiguration.php (1 issue)

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 Magium\Configuration\View;
4
5
use Psr\Http\Message\MessageInterface;
6
use Psr\Http\Message\ResponseInterface;
7
use Psr\Http\Message\ServerRequestInterface;
8
9
class ViewConfiguration
10
{
11
12
    protected $request;
13
    protected $response;
14
    protected $layoutFile;
15
    protected $viewDirectory;
16
    protected $viewFile;
17
    protected $jqueryUrl;
18
    protected $provideWrapperHtml;
19
    protected $bootstrapJsUrl;
20
    protected $bootstrapCssUrl;
21
22
    /**
23
     * ViewConfiguration constructor.
24
     * @param ServerRequestInterface $request
25
     * @param MessageInterface $response
26
     * @param string $viewDirectory
27
     * @param string $layoutFile
28
     * @param string $viewFile
29
     * @param boolean $provideWrapperHtml
30
     * @param boolean $provideJqueryUrl
0 ignored issues
show
There is no parameter named $provideJqueryUrl. Did you maybe mean $jqueryUrl?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
31
     * @throws InvalidViewConfigurationException
32
     */
33 23
    public function __construct(
34
        ServerRequestInterface $request,
35
        MessageInterface $response,
36
        $viewDirectory = __DIR__ . '/views' ,
37
        $layoutFile = 'layout.phtml',
38
        $viewFile = 'view.phtml',
39
        $provideWrapperHtml = true,
40
        $jqueryUrl = 'https://code.jquery.com/jquery-3.2.1.min.js',
41
        $bootstrapJsUrl = 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js',
42
        $bootstrapCssUrl = 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'
43
    )
44
    {
45 23
        $this->setRequest($request);
46 23
        $this->setResponse($response);
47 23
        $this->setViewDirectory($viewDirectory);
48 22
        $this->setLayoutFile($layoutFile);
49 21
        $this->setViewFile($viewFile);
50 20
        $this->setProvideWrapperHtml($provideWrapperHtml);
51 20
        $this->setJqueryUrl($jqueryUrl);
52 20
        $this->setBootstrapJsUrl($bootstrapJsUrl);
53 20
        $this->setBootstrapCssUrl($bootstrapCssUrl);
54 20
    }
55
56
    /**
57
     * @return mixed
58
     */
59 9
    public function getBootstrapCssUrl()
60
    {
61 9
        return $this->bootstrapCssUrl;
62
    }
63
64
    /**
65
     * @param mixed $bootstrapCssUrl
66
     */
67 20
    public function setBootstrapCssUrl($bootstrapCssUrl)
68
    {
69 20
        $this->bootstrapCssUrl = $bootstrapCssUrl;
70 20
    }
71
72
    /**
73
     * @return mixed
74
     */
75 9
    public function getBootstrapJsUrl()
76
    {
77 9
        return $this->bootstrapJsUrl;
78
    }
79
80
    /**
81
     * @param mixed $bootstrapJsUrl
82
     */
83 20
    public function setBootstrapJsUrl($bootstrapJsUrl)
84
    {
85 20
        $this->bootstrapJsUrl = $bootstrapJsUrl;
86 20
    }
87
88
89
90
    /**
91
     * @return mixed
92
     */
93 9
    public function getProvideWrapperHtml()
94
    {
95 9
        return $this->provideWrapperHtml;
96
    }
97
98
    /**
99
     * @param mixed $provideWrapperHtml
100
     */
101 20
    public function setProvideWrapperHtml($provideWrapperHtml)
102
    {
103 20
        $this->provideWrapperHtml = $provideWrapperHtml;
104 20
    }
105
106
    /**
107
     * @return ServerRequestInterface
108
     */
109 1
    public function getRequest()
110
    {
111 1
        return $this->request;
112
    }
113
114
    /**
115
     * @param ServerRequestInterface $request
116
     */
117 23
    public function setRequest(ServerRequestInterface $request)
118
    {
119 23
        $this->request = $request;
120 23
    }
121
122
    /**
123
     * @return ResponseInterface
124
     */
125 1
    public function getResponse()
126
    {
127 1
        return $this->response;
128
    }
129
130
    /**
131
     * @param MessageInterface $response
132
     */
133 23
    public function setResponse(MessageInterface $response)
134
    {
135 23
        $this->response = $response;
136 23
    }
137
138
    /**
139
     * @return string
140
     */
141 9
    public function getLayoutFile()
142
    {
143 9
        return $this->layoutFile;
144
    }
145
146
    /**
147
     * @param string $layoutFile
148
     * @throws InvalidViewConfigurationException
149
     */
150 22 View Code Duplication
    public function setLayoutFile($layoutFile)
151
    {
152 22
        $this->layoutFile = realpath($this->getViewDirectory() . DIRECTORY_SEPARATOR . $layoutFile);
153 22
        if (!is_file($this->layoutFile)) {
154 1
            throw new InvalidViewConfigurationException('Could not resolve base layout file: ' . $layoutFile);
155
        }
156 21
        $this->layoutFile = basename($this->layoutFile);
157 21
    }
158
159
    /**
160
     * @return string
161
     */
162 22
    public function getViewDirectory()
163
    {
164 22
        return $this->viewDirectory;
165
    }
166
167
    /**
168
     * @param string $viewDirectory
169
     * @throws InvalidViewConfigurationException
170
     */
171 23
    public function setViewDirectory($viewDirectory)
172
    {
173 23
        $this->viewDirectory = realpath($viewDirectory);
174 23
        if (!is_dir($this->viewDirectory)) {
175 1
            throw new InvalidViewConfigurationException('Could not resolve base view directory: ' . $viewDirectory);
176
        }
177 22
    }
178
179
    /**
180
     * @return string
181
     */
182 1
    public function getViewFile()
183
    {
184 1
        return $this->viewFile;
185
    }
186
187
    /**
188
     * @param string $viewFile
189
     * @throws InvalidViewConfigurationException
190
     */
191 21 View Code Duplication
    public function setViewFile($viewFile)
192
    {
193 21
        $this->viewFile = realpath($this->getViewDirectory() . DIRECTORY_SEPARATOR . $viewFile);
194 21
        if (!is_file($this->viewFile)) {
195 1
            throw new InvalidViewConfigurationException('Could not resolve base file file: ' . $viewFile);
196
        }
197 20
        $this->viewFile = basename($this->viewFile);
198 20
    }
199
200
    /**
201
     * @return mixed
202
     */
203 9
    public function getJqueryUrl()
204
    {
205 9
        return $this->jqueryUrl;
206
    }
207
208
    /**
209
     * @param mixed $jqueryUrl
210
     */
211 20
    public function setJqueryUrl($jqueryUrl)
212
    {
213 20
        $this->jqueryUrl = $jqueryUrl;
214 20
    }
215
216
217
218
219
}
220