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/Card.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
3
namespace Getnet\API;
4
5
/**
6
 * Class Card
7
 *
8
 * @package Getnet\API
9
 */
10
class Card implements \JsonSerializable
11
{
12
    const BRAND_MASTERCARD  = "Mastercard";
13
    const BRAND_VISA        = "Visa";
14
    const BRAND_AMEX        = "Amex";
15
    const BRAND_ELO         = "Elo";
16
    const BRAND_HIPERCARD   = "Hipercard";
17
18
    /** @var */
19
    private $brand;
20
21
    /** @var */
22
    private $cardholder_name;
23
24
    /** @var */
25
    private $expiration_month;
26
27
    /** @var */
28
    private $expiration_year;
29
30
    /** @var */
31
    private $number_token;
32
33
    /** @var */
34
    private $security_code;
35
36
    /**
37
     * Card constructor.
38
     * @param Token $token
39
     */
40
    public function __construct(Token $token)
41
    {
42
        $this->setNumberToken($token);
43
    }
44
45
    /**
46
     *
47
     * @return array
48
     */
49 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...
50
    {
51
        $vars = get_object_vars($this);
52
        $vars_clear = array_filter($vars, function ($value) {
53
            return null !== $value;
54
        });
55
56
        return $vars_clear;
57
    }
58
59
    /**
60
     * @return mixed
61
     */
62
    public function getBrand()
63
    {
64
        return $this->brand;
65
    }
66
67
    /**
68
     * @param $brand
69
     * @return $this
70
     */
71
    public function setBrand($brand)
72
    {
73
        $this->brand = (string)$brand;
74
75
        return $this;
76
    }
77
78
    /**
79
     * @return mixed
80
     */
81
    public function getCardholderName()
82
    {
83
        return $this->cardholder_name;
84
    }
85
86
    /**
87
     * @param $cardholder_name
88
     * @return $this
89
     */
90
    public function setCardholderName($cardholder_name)
91
    {
92
        $this->cardholder_name = (string)$cardholder_name;
93
94
        return $this;
95
    }
96
97
    /**
98
     * @return mixed
99
     */
100
    public function getExpirationMonth()
101
    {
102
        return $this->expiration_month;
103
    }
104
105
    /**
106
     * @param $expiration_month
107
     * @return $this
108
     */
109
    public function setExpirationMonth($expiration_month)
110
    {
111
        $this->expiration_month = (string)$expiration_month;
112
113
        return $this;
114
    }
115
116
    /**
117
     * @return mixed
118
     */
119
    public function getExpirationYear()
120
    {
121
        return $this->expiration_year;
122
    }
123
124
    /**
125
     * @param $expiration_year
126
     * @return $this
127
     */
128
    public function setExpirationYear($expiration_year)
129
    {
130
        $this->expiration_year = (string)$expiration_year;
131
132
        return $this;
133
    }
134
135
    /**
136
     * @return mixed
137
     */
138
    public function getNumberToken()
139
    {
140
        return $this->number_token;
141
    }
142
143
    /**
144
     * @param $token
145
     * @return $this
146
     */
147
    public function setNumberToken($token)
148
    {
149
        $this->number_token = (string)$token->getNumberToken();
150
151
        return $this;
152
    }
153
154
    /**
155
     * @return mixed
156
     */
157
    public function getSecurityCode()
158
    {
159
        return $this->security_code;
160
    }
161
162
    /**
163
     * @param $security_code
164
     * @return $this
165
     */
166
    public function setSecurityCode($security_code)
167
    {
168
        $this->security_code = (string)$security_code;
169
170
        return $this;
171
    }
172
173
    /**
174
     * @return false|string
175
     */
176 View Code Duplication
    public function toJSON()
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...
177
    {
178
        $vars = get_object_vars($this);
179
        $vars_clear = array_filter($vars, function ($value) {
180
            return null !== $value;
181
        });
182
183
        return json_encode($vars_clear, JSON_PRETTY_PRINT);
184
    }
185
}
186