Completed
Push — master ( bdfee2...e6cd81 )
by Olivier
02:17
created

Settings   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 68
ccs 10
cts 20
cp 0.5
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A createFromArray() 0 11 1
A getBranding() 0 4 1
A getCardPayments() 0 4 1
A getDashboard() 0 4 1
A getPayments() 0 4 1
A getPayouts() 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\Account;
11
12
use Shapin\Stripe\Model\CreatableFromArray;
13
14
final class Settings implements CreatableFromArray
15
{
16
    /**
17
     * @var array
18
     */
19
    private $branding;
20
21
    /**
22
     * @var array
23
     */
24
    private $cardPayments;
25
26
    /**
27
     * @var array
28
     */
29
    private $dashboard;
30
31
    /**
32
     * @var array
33
     */
34
    private $payments;
35
36
    /**
37
     * @var array
38
     */
39
    private $payouts;
40
41 5
    private function __construct()
42
    {
43 5
    }
44
45 5
    public static function createFromArray(array $data)
46
    {
47 5
        $model = new self();
48 5
        $model->branding = $data['branding'];
49 5
        $model->cardPayments = $data['card_payments'];
50 5
        $model->dashboard = $data['dashboard'];
51 5
        $model->payments = $data['payments'];
52 5
        $model->payouts = $data['payouts'] ?? [];
53
54 5
        return $model;
55
    }
56
57
    public function getBranding(): array
58
    {
59
        return $this->branding;
60
    }
61
62
    public function getCardPayments(): array
63
    {
64
        return $this->cardPayments;
65
    }
66
67
    public function getDashboard(): array
68
    {
69
        return $this->dashboard;
70
    }
71
72
    public function getPayments(): array
73
    {
74
        return $this->payments;
75
    }
76
77
    public function getPayouts(): array
78
    {
79
        return $this->payouts;
80
    }
81
}
82