TaxInfoVerification::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 3
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\Customer;
11
12
use Shapin\Stripe\Model\CreatableFromArray;
13
14
final class TaxInfoVerification implements CreatableFromArray
15
{
16
    const STATUS_UNVERIFIED = 'unverified';
17
    const STATUS_PENDING = 'pending';
18
    const STATUS_VERIFIED = 'verified';
19
20
    /**
21
     * @var string
22
     */
23
    private $status;
24
25
    /**
26
     * @var string
27
     */
28
    private $verifiedName;
29
30
    private function __construct()
31
    {
32
    }
33
34
    public static function createFromArray(array $data): self
35
    {
36
        $model = new self();
37
        $model->status = $data['status'];
38
        $model->verifiedName = $data['verified_name'];
39
40
        return $model;
41
    }
42
43
    public function isUnverified(): bool
44
    {
45
        return self::STATUS_UNVERIFIED === $this->status;
46
    }
47
48
    public function isPending(): bool
49
    {
50
        return self::STATUS_PENDING === $this->status;
51
    }
52
53
    public function isVerified(): bool
54
    {
55
        return self::STATUS_VERIFIED === $this->status;
56
    }
57
58
    public function getStatus(): string
59
    {
60
        return $this->status;
61
    }
62
63
    public function getVerifiedName(): ?string
64
    {
65
        return $this->verifiedName;
66
    }
67
}
68