shapintv /
stripe
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
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
|
|||
| 111 | 5 | $model->reversals = TransferReversalCollection::createFromArray($data['reversals']); |
|
|
0 ignored issues
–
show
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 |
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..