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/Refund/Refund.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\Refund;
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\MetadataCollection;
17
use Shapin\Stripe\Model\MetadataTrait;
18
19
final class Refund implements CreatableFromArray, ContainsMetadata
20
{
21
    use MetadataTrait;
22
23
    /**
24
     * @var Money
25
     */
26
    private $amount;
27
28
    /**
29
     * @var string
30
     */
31
    private $balanceTransaction;
32
33
    /**
34
     * @var string
35
     */
36
    private $charge;
37
38
    /**
39
     * @var \DateTimeImmutable
40
     */
41
    private $createdAt;
42
43
    /**
44
     * @var Currency
45
     */
46
    private $currency;
47
48
    /**
49
     * @var string
50
     */
51
    private $failureBalanceTransaction;
52
53
    /**
54
     * @var string
55
     */
56
    private $failureReason;
57
58
    /**
59
     * @var string
60
     */
61
    private $reason;
62
63
    /**
64
     * @var string
65
     */
66
    private $receiptNumber;
67
68
    /**
69
     * @var string
70
     */
71
    private $sourceTransferReversal;
72
73
    /**
74
     * @var string
75
     */
76
    private $status;
77
78 8
    public static function createFromArray(array $data): self
79
    {
80 8
        $currency = new Currency(strtoupper($data['currency']));
81
82 8
        $model = new self();
83 8
        $model->amount = new Money($data['amount'], $currency);
84 8
        $model->balanceTransaction = $data['balance_transaction'];
85 8
        $model->charge = $data['charge'];
86 8
        $model->createdAt = new \DateTimeImmutable('@'.$data['created']);
87 8
        $model->currency = $currency;
88 8
        $model->failureBalanceTransaction = $data['failure_balance_transaction'] ?? null;
89 8
        $model->failureReason = $data['failure_reason'] ?? null;
90 8
        $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...
91 8
        $model->reason = $data['reason'];
92 8
        $model->receiptNumber = $data['receipt_number'];
93 8
        $model->sourceTransferReversal = $data['source_transfer_reversal'] ?? null;
94 8
        $model->status = $data['status'];
95
96 8
        return $model;
97
    }
98
99 1
    public function getAmount(): Money
100
    {
101 1
        return $this->amount;
102
    }
103
104 1
    public function getBalanceTransaction(): ?string
105
    {
106 1
        return $this->balanceTransaction;
107
    }
108
109 1
    public function getCharge(): string
110
    {
111 1
        return $this->charge;
112
    }
113
114 1
    public function getCreatedAt(): \DateTimeImmutable
115
    {
116 1
        return $this->createdAt;
117
    }
118
119 1
    public function getCurrency(): Currency
120
    {
121 1
        return $this->currency;
122
    }
123
124 1
    public function getFailureBalanceTransaction(): ?string
125
    {
126 1
        return $this->failureBalanceTransaction;
127
    }
128
129 1
    public function getFailureReason(): ?string
130
    {
131 1
        return $this->failureReason;
132
    }
133
134 1
    public function getReason(): ?string
135
    {
136 1
        return $this->reason;
137
    }
138
139 1
    public function getReceiptNumber(): ?string
140
    {
141 1
        return $this->receiptNumber;
142
    }
143
144 1
    public function getSourceTransferReversal(): ?string
145
    {
146 1
        return $this->sourceTransferReversal;
147
    }
148
149 1
    public function getStatus(): string
150
    {
151 1
        return $this->status;
152
    }
153
}
154