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/Account/Account.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
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\Account;
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 Account implements CreatableFromArray, ContainsMetadata
19
{
20
    use MetadataTrait;
21
22
    const BUSINESS_TYPE_INDIVIDUAL = 'individual';
23
    const BUSINESS_TYPE_COMPANY = 'company';
24
25
    const TYPE_CUSTOM = 'custom';
26
    const TYPE_STANDARD = 'standard';
27
28
    /**
29
     * @var string
30
     */
31
    private $id;
32
33
    /**
34
     * @var ?BusinessProfile
35
     */
36
    private $businessProfile;
37
38
    /**
39
     * @var ?string
40
     */
41
    private $businessType;
42
43
    /**
44
     * @var array
45
     */
46
    private $capabilities;
47
48
    /**
49
     * @var bool
50
     */
51
    private $chargesEnabled;
52
53
    /**
54
     * @var ?Company
55
     */
56
    private $company;
57
58
    /**
59
     * @var string
60
     */
61
    private $country;
62
63
    /**
64
     * @var ?\DateTimeImmutable
65
     */
66
    private $createdAt;
67
68
    /**
69
     * @var Currency
70
     */
71
    private $defaultCurrency;
72
73
    /**
74
     * @var bool
75
     */
76
    private $detailsSubmitted;
77
78
    /**
79
     * @var string
80
     */
81
    private $email;
82
83
    /**
84
     * @var ExternalAccountCollection
85
     */
86
    private $externalAccounts;
87
88
    /**
89
     * @var bool
90
     */
91
    private $payoutsEnabled;
92
93
    /**
94
     * @var ?Requirements
95
     */
96
    private $requirements;
97
98
    /**
99
     * @var Settings
100
     */
101
    private $settings;
102
103
    /**
104
     * @var ?TermsOfServiceAcceptance
105
     */
106
    private $termsOfServiceAcceptance;
107
108
    /**
109
     * @var string
110
     */
111
    private $type;
112
113 4
    public static function createFromArray(array $data): self
114
    {
115 4
        $model = new self();
116 4
        $model->id = $data['id'];
117 4
        $model->businessProfile = isset($data['business_profile']) ? BusinessProfile::createFromArray($data['business_profile']) : null;
118 4
        $model->businessType = $data['business_type'] ?? null;
119 4
        $model->capabilities = $data['capabilities'] ?? [];
120 4
        $model->chargesEnabled = (bool) $data['charges_enabled'];
121 4
        $model->company = isset($data['company']) ? Company::createFromArray($data['company']) : null;
122 4
        $model->country = $data['country'];
123 4
        $model->createdAt = isset($data['created']) ? new \DateTimeImmutable('@'.$data['created']) : null;
124 4
        $model->defaultCurrency = new Currency(strtoupper($data['default_currency']));
125 4
        $model->detailsSubmitted = (bool) $data['details_submitted'];
126 4
        $model->email = $data['email'];
127 4
        $model->externalAccounts = ExternalAccountCollection::createFromArray($data['external_accounts'] ?? []);
0 ignored issues
show
Documentation Bug introduced by
It seems like \Shapin\Stripe\Model\Acc..._accounts'] ?? array()) of type object<self> is incompatible with the declared type object<Shapin\Stripe\Mod...ernalAccountCollection> of property $externalAccounts.

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...
128 4
        $model->metadata = MetadataCollection::createFromArray($data['metadata'] ?? [] ?? []);
0 ignored issues
show
Documentation Bug introduced by
It seems like \Shapin\Stripe\Model\Met... ?? array() ?? array()) 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...
129 4
        $model->payoutsEnabled = (bool) $data['payouts_enabled'];
130 4
        $model->requirements = isset($data['requirements']) ? Requirements::createFromArray($data['requirements']) : null;
131 4
        $model->settings = Settings::createFromArray($data['settings']);
132 4
        $model->termsOfServiceAcceptance = isset($data['tos_acceptance']) ? TermsOfServiceAcceptance::createFromArray($data['tos_acceptance']) : null;
133 4
        $model->type = $data['type'];
134
135 4
        return $model;
136
    }
137
138 1
    public function getId(): string
139
    {
140 1
        return $this->id;
141
    }
142
143 1
    public function getBusinessProfile(): ?BusinessProfile
144
    {
145 1
        return $this->businessProfile;
146
    }
147
148 1
    public function getBusinessType(): ?string
149
    {
150 1
        return $this->businessType;
151
    }
152
153 1
    public function getCapabilities(): array
154
    {
155 1
        return $this->capabilities;
156
    }
157
158 1
    public function areChargesEnabled(): bool
159
    {
160 1
        return $this->chargesEnabled;
161
    }
162
163
    public function getCompany(): ?Company
164
    {
165
        return $this->company;
166
    }
167
168 1
    public function getCountry(): string
169
    {
170 1
        return $this->country;
171
    }
172
173 1
    public function getCreatedAt(): ?\DateTimeImmutable
174
    {
175 1
        return $this->createdAt;
176
    }
177
178 1
    public function getDefaultCurrency(): Currency
179
    {
180 1
        return $this->defaultCurrency;
181
    }
182
183 1
    public function areDetailsSubmitted(): bool
184
    {
185 1
        return $this->detailsSubmitted;
186
    }
187
188 1
    public function getEmail(): string
189
    {
190 1
        return $this->email;
191
    }
192
193 1
    public function getExternalAccounts(): ExternalAccountCollection
194
    {
195 1
        return $this->externalAccounts;
196
    }
197
198 1
    public function arePayoutsEnabled(): bool
199
    {
200 1
        return $this->payoutsEnabled;
201
    }
202
203 1
    public function getRequirements(): ?Requirements
204
    {
205 1
        return $this->requirements;
206
    }
207
208 1
    public function getSettings(): Settings
209
    {
210 1
        return $this->settings;
211
    }
212
213 1
    public function getTermsOfServiceAcceptance(): ?TermsOfServiceAcceptance
214
    {
215 1
        return $this->termsOfServiceAcceptance;
216
    }
217
218 1
    public function getType(): string
219
    {
220 1
        return $this->type;
221
    }
222
}
223