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

Shipping::getPhone()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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\Address;
13
use Shapin\Stripe\Model\CreatableFromArray;
14
15
final class Shipping implements CreatableFromArray
16
{
17
    /**
18
     * @var Address
19
     */
20
    private $address;
21
22
    /**
23
     * @var ?string
24
     */
25
    private $carrier;
26
27
    /**
28
     * @var string
29
     */
30
    private $name;
31
32
    /**
33
     * @var string
34
     */
35
    private $phone;
36
37
    /**
38
     * @var ?string
39
     */
40
    private $trackingNumber;
41
42
    private function __construct()
43
    {
44
    }
45
46
    public static function createFromArray(array $data): self
47
    {
48
        $model = new self();
49
        $model->address = Address::createFromArray($data['address']);
50
        $model->carrier = $data['carrier'];
51
        $model->name = $data['name'];
52
        $model->phone = $data['phone'];
53
        $model->trackingNumber = $data['tracking_number'];
54
55
        return $model;
56
    }
57
58
    public function getAddress(): Address
59
    {
60
        return $this->address;
61
    }
62
63
    public function getCarrier(): ?string
64
    {
65
        return $this->carrier;
66
    }
67
68
    public function getName(): ?string
69
    {
70
        return $this->name;
71
    }
72
73
    public function getPhone(): ?string
74
    {
75
        return $this->phone;
76
    }
77
78
    public function getTrackingNumber(): ?string
79
    {
80
        return $this->trackingNumber;
81
    }
82
}
83