Issues (16)

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/Base/Address.php (2 issues)

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
namespace MrPrompt\ShipmentCommon\Base;
3
4
/**
5
 * Address
6
 *
7
 * @author Thiago Paes <[email protected]>
8
 */
9
class Address
10
{
11
    /**
12
     * City
13
     *
14
     * @var string
15
     */
16
    private $city;
17
18
    /**
19
     * State
20
     *
21
     * @var string
22
     */
23
    private $state;
24
25
    /**
26
     * Postal Code - CEP
27
     *
28
     * @var string
29
     */
30
    private $postalCode;
31
32
    /**
33
     * Address
34
     *
35
     * @var string
36
     */
37
    private $address;
38
39
    /**
40
     * Address Number
41
     *
42
     * @var int
43
     */
44
    private $number;
45
46
    /**
47
     * District
48
     *
49
     * @var string
50
     */
51
    private $district;
52
53
    /**
54
     * Complement
55
     *
56
     * @var string
57
     */
58
    private $complement;
59
60
    /**
61
     * Constructor
62
     * 
63
     * @param string $city
64
     * @param string $state
65
     * @param string $postalCode
66
     * @param string $address
67
     * @param string $number
68
     * @param string $district
69
     * @param string $complement
70
     */
71 17
    public function __construct(
72
        string $city = '',
73
        string $state = '',
74
        string $postalCode = '',
75
        string $address = '',
76
        string $number = '',
77
        string $district = '',
78
        string $complement = ''
79
    ) {
80 17
        $this->city = $city;
81 17
        $this->state = $state;
82 17
        $this->postalCode = $postalCode;
83 17
        $this->address = $address;
84 17
        $this->number = $number;
0 ignored issues
show
Documentation Bug introduced by
The property $number was declared of type integer, but $number is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
85 17
        $this->district = $district;
86 17
        $this->complement = $complement;
87 17
    }
88
89
    /**
90
     * Return the city
91
     * 
92
     * @return string
93
     */
94 1
    public function getCity(): string
95
    {
96 1
        return $this->city;
97
    }
98
99
    /**
100
     * Set the city
101
     * 
102
     * @param string $city
103
     */
104 2
    public function setCity(string $city)
105
    {
106 2
        $this->city = $city;
107 2
    }
108
109
    /**
110
     * Get the state
111
     * 
112
     * @return string
113
     */
114 1
    public function getState(): string
115
    {
116 1
        return $this->state;
117
    }
118
119
    /**
120
     * Set the state
121
     * 
122
     * @param string $state
123
     */
124 2
    public function setState(string $state)
125
    {
126 2
        $this->state = $state;
127 2
    }
128
129
    /**
130
     * Get the postal code
131
     * 
132
     * @return string
133
     */
134 1
    public function getPostalCode(): string
135
    {
136 1
        return $this->postalCode;
137
    }
138
139
    /**
140
     * Set the postal code
141
     * 
142
     * @param string $postalCode
143
     */
144 1
    public function setPostalCode(string $postalCode)
145
    {
146 1
        $this->postalCode = $postalCode;
147 1
    }
148
149
    /**
150
     * @return the $address
151
     */
152 1
    public function getAddress()
153
    {
154 1
        return $this->address;
155
    }
156
157
    /**
158
     * @param string $address
159
     */
160 2
    public function setAddress(string $address)
161
    {
162 2
        $this->address = $address;
163 2
    }
164
165
    /**
166
     * @return the $number
167
     */
168 1
    public function getNumber(): string
169
    {
170 1
        return $this->number;
171
    }
172
173
    /**
174
     * @param string $number
175
     */
176 1
    public function setNumber(string $number)
177
    {
178 1
        $this->number = $number;
0 ignored issues
show
Documentation Bug introduced by
The property $number was declared of type integer, but $number is of type string. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
179 1
    }
180
181
    /**
182
     * @return the $district
183
     */
184 1
    public function getDistrict(): string
185
    {
186 1
        return $this->district;
187
    }
188
189
    /**
190
     * @param string $district
191
     */
192 1
    public function setDistrict(string $district)
193
    {
194 1
        $this->district = $district;
195 1
    }
196
197
    /**
198
     * @return the $complement
199
     */
200 1
    public function getComplement(): string
201
    {
202 1
        return $this->complement;
203
    }
204
205
    /**
206
     * @param string $complement
207
     */
208 1
    public function setComplement(string $complement)
209
    {
210 1
        $this->complement = $complement;
211 1
    }
212
}
213