Completed
Push — master ( b6f7ca...4aea47 )
by Olivier
03:30
created

NextAction   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 45
ccs 0
cts 20
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A createFromArray() 0 9 1
A getRedirectToUrl() 0 4 1
A getType() 0 4 1
A getUseStripeSDK() 0 4 1
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\PaymentIntent;
11
12
use Shapin\Stripe\Model\Charge\ChargeCollection;
13
use Shapin\Stripe\Model\CreatableFromArray;
14
use Shapin\Stripe\Model\Customer\CustomField;
15
use Shapin\Stripe\Model\Source\Source;
16
use Money\Currency;
17
use Money\Money;
18
19
final class NextAction implements CreatableFromArray
20
{
21
    const TYPE_REDIRECT_TO_URL = 'redirect_to_url';
22
    const TYPE_USE_STRIPE_SDK = 'use_stripe_sdk';
23
24
    /**
25
     * @var ?array
26
     */
27
    private $redirectToUrl;
28
29
    /**
30
     * @var string
31
     */
32
    private $type;
33
34
    /**
35
     * @var ?array
36
     */
37
    private $useStripeSDK;
38
39
    public static function createFromArray(array $data): self
40
    {
41
        $model = new self();
42
        $model->redirectToUrl = $data['redirect_to_url'];
43
        $model->type = $data['type'];
44
        $model->useStripeSDK = $data['use_stripe_sdk'];
45
46
        return $model;
47
    }
48
49
    public function getRedirectToUrl(): ?array
50
    {
51
        return $this->redirectToUrl;
52
    }
53
54
    public function getType(): string
55
    {
56
        return $this->type;
57
    }
58
59
    public function getUseStripeSDK(): ?array
60
    {
61
        return $this->useStripeSDK;
62
    }
63
}
64