Passed
Pull Request — master (#15)
by
unknown
03:46
created

LabelMonetaryAccount   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 48
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A fromArray() 0 4 1
A iban() 0 4 1
A displayName() 0 4 1
1
<?php declare(strict_types = 1);
2
3
namespace Link0\Bunq\Domain;
4
5
6
final class LabelMonetaryAccount
7
{
8
    /**
9
     * @var string
10
     */
11
    protected $iban;
12
13
    /**
14
     * @var string
15
     */
16
    protected $display_name;
17
18
    /**
19
     * LabelMonetaryAccount constructor.
20
     * @param array $labelMonetaryAccount
21
     */
22
    private function __construct(array $labelMonetaryAccount)
23
    {
24
        $this->iban = $labelMonetaryAccount['iban'];
25
        $this->display_name = $labelMonetaryAccount['display_name'];
26
    }
27
28
    /**
29
     * @param array $labelMonetaryAccount
30
     * @return LabelMonetaryAccount
31
     */
32
    public static function fromArray(array $labelMonetaryAccount): LabelMonetaryAccount
33
    {
34
        return new self($labelMonetaryAccount);
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function iban(): string
41
    {
42
        return $this->iban;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function displayName(): string
49
    {
50
        return $this->display_name;
51
    }
52
53
}