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/Transfer/Transfer.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\Transfer;
11
12
use Money\Currency;
13
use Money\Money;
14
use Shapin\Stripe\Model\ContainsMetadata;
15
use Shapin\Stripe\Model\CreatableFromArray;
16
use Shapin\Stripe\Model\LivemodeTrait;
17
use Shapin\Stripe\Model\MetadataCollection;
18
use Shapin\Stripe\Model\MetadataTrait;
19
20
final class Transfer implements CreatableFromArray, ContainsMetadata
21
{
22
    use LivemodeTrait;
23
    use MetadataTrait;
24
25
    /**
26
     * @var string
27
     */
28
    private $id;
29
30
    /**
31
     * @var Money
32
     */
33
    private $amount;
34
35
    /**
36
     * @var Money
37
     */
38
    private $amountReversed;
39
40
    /**
41
     * @var string
42
     */
43
    private $balanceTransaction;
44
45
    /**
46
     * @var \DateTimeImmutable
47
     */
48
    private $createdAt;
49
50
    /**
51
     * @var Currency
52
     */
53
    private $currency;
54
55
    /**
56
     * @var string
57
     */
58
    private $description;
59
60
    /**
61
     * @var string
62
     */
63
    private $destination;
64
65
    /**
66
     * @var string
67
     */
68
    private $destinationPayment;
69
70
    /**
71
     * @var TransferReversalCollection
72
     */
73
    private $reversals;
74
75
    /**
76
     * @var bool
77
     */
78
    private $reversed;
79
80
    /**
81
     * @var string
82
     */
83
    private $sourceTransaction;
84
85
    /**
86
     * @var string
87
     */
88
    private $sourceType;
89
90
    /**
91
     * @var string
92
     */
93
    private $transferGroup;
94
95 5
    public static function createFromArray(array $data): self
96
    {
97 5
        $currency = new Currency(strtoupper($data['currency']));
98
99 5
        $model = new self();
100 5
        $model->id = $data['id'];
101 5
        $model->amount = new Money($data['amount'], $currency);
102 5
        $model->amountReversed = new Money($data['amount_reversed'], $currency);
103 5
        $model->balanceTransaction = $data['balance_transaction'];
104 5
        $model->createdAt = new \DateTimeImmutable('@'.$data['created']);
105 5
        $model->currency = $currency;
106 5
        $model->description = $data['description'];
107 5
        $model->destination = $data['destination'];
108 5
        $model->destinationPayment = $data['destination_payment'] ?? null;
109 5
        $model->live = (bool) $data['livemode'];
110 5
        $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...
111 5
        $model->reversals = TransferReversalCollection::createFromArray($data['reversals']);
0 ignored issues
show
Documentation Bug introduced by
It seems like \Shapin\Stripe\Model\Tra...ray($data['reversals']) of type object<self> is incompatible with the declared type object<Shapin\Stripe\Mod...sferReversalCollection> of property $reversals.

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...
112 5
        $model->reversed = (bool) $data['reversed'];
113 5
        $model->sourceTransaction = $data['source_transaction'];
114 5
        $model->sourceType = $data['source_type'];
115 5
        $model->transferGroup = $data['transfer_group'];
116
117 5
        return $model;
118
    }
119
120 1
    public function getId(): string
121
    {
122 1
        return $this->id;
123
    }
124
125 1
    public function getAmount(): Money
126
    {
127 1
        return $this->amount;
128
    }
129
130 1
    public function getAmountReversed(): Money
131
    {
132 1
        return $this->amountReversed;
133
    }
134
135 1
    public function getBalanceTransaction(): ?string
136
    {
137 1
        return $this->balanceTransaction;
138
    }
139
140 1
    public function getCreatedAt(): \DateTimeImmutable
141
    {
142 1
        return $this->createdAt;
143
    }
144
145 1
    public function getCurrency(): Currency
146
    {
147 1
        return $this->currency;
148
    }
149
150 1
    public function getDescription(): ?string
151
    {
152 1
        return $this->description;
153
    }
154
155 1
    public function getDestination(): string
156
    {
157 1
        return $this->destination;
158
    }
159
160 1
    public function getDestinationPayment(): ?string
161
    {
162 1
        return $this->destinationPayment;
163
    }
164
165 1
    public function getTransferReversals(): TransferReversalCollection
166
    {
167 1
        return $this->reversals;
168
    }
169
170 1
    public function isReversed(): bool
171
    {
172 1
        return $this->reversed;
173
    }
174
175 1
    public function getSourceTransaction(): ?string
176
    {
177 1
        return $this->sourceTransaction;
178
    }
179
180 1
    public function getSourceType(): string
181
    {
182 1
        return $this->sourceType;
183
    }
184
185 1
    public function getTransferGroup(): ?string
186
    {
187 1
        return $this->transferGroup;
188
    }
189
}
190