Issues (93)

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/Model/Card/Card.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
declare(strict_types=1);
4
5
/*
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Shapin\Stripe\Model\Card;
11
12
use Money\Currency;
13
use Shapin\Stripe\Model\ContainsMetadata;
14
use Shapin\Stripe\Model\CreatableFromArray;
15
use Shapin\Stripe\Model\MetadataCollection;
16
use Shapin\Stripe\Model\MetadataTrait;
17
18
final class Card implements CreatableFromArray, ContainsMetadata
19
{
20
    use MetadataTrait;
21
22
    /**
23
     * @var string
24
     */
25
    private $id;
26
27
    /**
28
     * @var string
29
     */
30
    private $account;
31
32
    /**
33
     * @var ?Address
34
     */
35
    private $address;
36
37
    /**
38
     * @var ?array
39
     */
40
    private $availablePayoutMethods;
41
42
    /**
43
     * @var ?string
44
     */
45
    private $brand;
46
47
    /**
48
     * @var string
49
     */
50
    private $country;
51
52
    /**
53
     * @var ?Currency
54
     */
55
    private $currency;
56
57
    /**
58
     * @var string
59
     */
60
    private $customer;
61
62
    /**
63
     * @var string
64
     */
65
    private $cvcCheck;
66
67
    /**
68
     * @var ?bool
69
     */
70
    private $defaultForCurrency;
71
72
    /**
73
     * @var string
74
     */
75
    private $dynamicLastFour;
76
77
    /**
78
     * @var ?int
79
     */
80
    private $expirationMonth;
81
82
    /**
83
     * @var ?int
84
     */
85
    private $expirationYear;
86
87
    /**
88
     * @var ?string
89
     */
90
    private $fingerprint;
91
92
    /**
93
     * @var ?string
94
     */
95
    private $funding;
96
97
    /**
98
     * @var ?string
99
     */
100
    private $lastFour;
101
102
    /**
103
     * @var ?string
104
     */
105
    private $name;
106
107
    /**
108
     * @var string
109
     */
110
    private $recipient;
111
112
    /**
113
     * @var string
114
     */
115
    private $tokenizationMethod;
116
117 11
    public static function createFromArray(array $data): self
118
    {
119 11
        $model = new self();
120 11
        $model->id = $data['id'];
121 11
        $model->account = $data['account'] ?? null;
122 11
        $model->address = \array_key_exists('address_city', $data) ? Address::createFromArray($data) : null;
123 11
        $model->availablePayoutMethods = $data['available_payout_methods'] ?? null;
124 11
        $model->brand = $data['brand'] ?? null;
125 11
        $model->country = $data['country'];
126 11
        $model->currency = isset($data['currency']) ? new Currency(strtoupper($data['currency'])) : null;
127 11
        $model->customer = $data['customer'] ?? null;
128 11
        $model->cvcCheck = $data['cvc_check'] ?? null;
129 11
        $model->defaultForCurrency = isset($data['default_for_currency']) ? (bool) $data['default_for_currency'] : null;
130 11
        $model->dynamicLastFour = $data['dynamic_last4'] ?? null;
131 11
        $model->expirationMonth = isset($data['exp_month']) ? (int) $data['exp_month'] : null;
132 11
        $model->expirationYear = isset($data['exp_year']) ? (int) $data['exp_year'] : null;
133 11
        $model->fingerprint = $data['fingerprint'] ?? null;
134 11
        $model->funding = $data['funding'] ?? null;
135 11
        $model->lastFour = $data['last4'] ?? null;
136 11
        $model->metadata = MetadataCollection::createFromArray($data['metadata']);
0 ignored issues
show
Documentation Bug introduced by
It seems like \Shapin\Stripe\Model\Met...rray($data['metadata']) of type object<self> is incompatible with the declared type object<Shapin\Stripe\Model\MetadataCollection> of property $metadata.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
137 11
        $model->name = $data['name'] ?? null;
138 11
        $model->recipient = $data['recipient'] ?? null;
139 11
        $model->tokenizationMethod = $data['tokenization_method'] ?? null;
140
141 11
        return $model;
142
    }
143
144 1
    public function getId(): string
145
    {
146 1
        return $this->id;
147
    }
148
149
    public function getAccount(): ?string
150
    {
151
        return $this->account;
152
    }
153
154 1
    public function getAddress(): ?Address
155
    {
156 1
        return $this->address;
157
    }
158
159 1
    public function getAvailablePayoutMethods(): ?array
160
    {
161 1
        return $this->availablePayoutMethods;
162
    }
163
164 1
    public function getBrand(): ?string
165
    {
166 1
        return $this->brand;
167
    }
168
169 1
    public function getCountry(): string
170
    {
171 1
        return $this->country;
172
    }
173
174 1
    public function getCurrency(): ?Currency
175
    {
176 1
        return $this->currency;
177
    }
178
179 1
    public function getCustomer(): ?string
180
    {
181 1
        return $this->customer;
182
    }
183
184
    public function getCvcCheck(): ?string
185
    {
186
        return $this->cvcCheck;
187
    }
188
189 1
    public function getDefaultForCurrency(): ?bool
190
    {
191 1
        return $this->defaultForCurrency;
192
    }
193
194 1
    public function getDynamicLastFour(): ?string
195
    {
196 1
        return $this->dynamicLastFour;
197
    }
198
199 1
    public function getExpirationMonth(): ?int
200
    {
201 1
        return $this->expirationMonth;
202
    }
203
204 1
    public function getExpirationYear(): ?int
205
    {
206 1
        return $this->expirationYear;
207
    }
208
209 1
    public function getFingerprint(): ?string
210
    {
211 1
        return $this->fingerprint;
212
    }
213
214 1
    public function getFunding(): ?string
215
    {
216 1
        return $this->funding;
217
    }
218
219 1
    public function getLastFour(): ?string
220
    {
221 1
        return $this->lastFour;
222
    }
223
224 1
    public function getName(): ?string
225
    {
226 1
        return $this->name;
227
    }
228
229 1
    public function getRecipient(): ?string
230
    {
231 1
        return $this->recipient;
232
    }
233
234 1
    public function getTokenizationMethod(): ?string
235
    {
236 1
        return $this->tokenizationMethod;
237
    }
238
}
239