Issues (10)

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/Getnet/API/Customer.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 Getnet\API;
4
5
/**
6
 * Class Customer
7
 *
8
 * @package Getnet\API
9
 */
10
class Customer implements \JsonSerializable
11
{
12
    const DOCUMENT_TYPE_CPF  = "CPF";
13
    const DOCUMENT_TYPE_CNPJ = "CNPJ";
14
15
    /** @var */
16
    private $customer_id;
17
18
    /** @var */
19
    private $first_name;
20
21
    /** @var */
22
    private $last_name;
23
24
    /** @var */
25
    private $name;
26
27
    /** @var */
28
    private $email;
29
30
    /** @var */
31
    private $document_type;
32
33
    /** @var */
34
    private $document_number;
35
36
    /** @var */
37
    private $phone_number;
38
39
    /** @var */
40
    private $billing_address;
41
42
    /**
43
     * Customer constructor.
44
     * @param $customer_id
45
     */
46
    public function __construct($customer_id)
47
    {
48
        $this->setCustomerId($customer_id);
49
    }
50
51
    /**
52
     * @return array|mixed
53
     */
54 View Code Duplication
    public function jsonSerialize()
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
55
    {
56
        $vars = get_object_vars($this);
57
58
        $vars_clear = array_filter($vars, function ($value) {
59
            return null !== $value;
60
        });
61
62
        return $vars_clear;
63
    }
64
65
    /**
66
     * @return mixed
67
     */
68
    public function getCustomerId()
69
    {
70
        return $this->customer_id;
71
    }
72
73
    /**
74
     * @param $customer_id
75
     * @return $this
76
     */
77
    public function setCustomerId($customer_id)
78
    {
79
        $this->customer_id = (string)$customer_id;
80
81
        return $this;
82
    }
83
84
    /**
85
     * @return mixed
86
     */
87
    public function getFirstName()
88
    {
89
        return $this->first_name;
90
    }
91
92
    /**
93
     * @param $first_name
94
     * @return $this
95
     */
96
    public function setFirstName($first_name)
97
    {
98
        $this->first_name = (string)$first_name;
99
100
        return $this;
101
    }
102
103
    /**
104
     * @return mixed
105
     */
106
    public function getLastName()
107
    {
108
        return $this->last_name;
109
    }
110
111
    /**
112
     * @param $last_name
113
     * @return $this
114
     */
115
    public function setLastName($last_name)
116
    {
117
        $this->last_name = (string)$last_name;
118
119
        return $this;
120
    }
121
122
    /**
123
     * @return mixed
124
     */
125
    public function getName()
126
    {
127
        return $this->name;
128
    }
129
130
    /**
131
     * @param $name
132
     * @return $this
133
     */
134
    public function setName($name)
135
    {
136
        $this->name = (string)$name;
137
138
        return $this;
139
    }
140
141
    /**
142
     * @return mixed
143
     */
144
    public function getEmail()
145
    {
146
        return $this->email;
147
    }
148
149
    /**
150
     * @param $email
151
     * @return $this
152
     */
153
    public function setEmail($email)
154
    {
155
        $this->email = (string)$email;
156
157
        return $this;
158
    }
159
160
    /**
161
     * @return mixed
162
     */
163
    public function getDocumentType()
164
    {
165
        return $this->document_type;
166
    }
167
168
    /**
169
     * @param $document_type
170
     * @return $this
171
     */
172
    public function setDocumentType($document_type)
173
    {
174
        $this->document_type = (string)$document_type;
175
176
        return $this;
177
    }
178
179
    /**
180
     * @return mixed
181
     */
182
    public function getDocumentNumber()
183
    {
184
        return $this->document_number;
185
    }
186
187
    /**
188
     * @param $document_number
189
     * @return $this
190
     */
191
    public function setDocumentNumber($document_number)
192
    {
193
        $this->document_number = (string)$document_number;
194
195
        return $this;
196
    }
197
198
    /**
199
     * @return mixed
200
     */
201
    public function getPhoneNumber()
202
    {
203
        return $this->phone_number;
204
    }
205
206
    /**
207
     * @param $phone_number
208
     * @return $this
209
     */
210
    public function setPhoneNumber($phone_number)
211
    {
212
        $this->phone_number = (string)$phone_number;
213
214
        return $this;
215
    }
216
217
    /**
218
     * @return Address
219
     */
220
    public function billingAddress()
221
    {
222
        $address = new Address();
223
224
        $this->setBillingAddress($address);
225
226
        return $address;
227
    }
228
229
    /**
230
     * @return mixed
231
     */
232
    public function getBillingAddress()
233
    {
234
        return $this->billing_address;
235
    }
236
237
    /**
238
     * @param $billing_address
239
     * @return $this
240
     */
241
    public function setBillingAddress($billing_address)
242
    {
243
        $this->billing_address = $billing_address;
244
245
        return $this;
246
    }
247
}
248