Card::getAccount()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Mukhin\PrivatbankBundle\Model;
4
5
class Card
6
{
7
    /** @var string */
8
    protected $account;
9
10
    /** @var string */
11
    protected $currency;
12
13
    /** @var string */
14
    protected $cardNumber;
15
16
    public static function fromResponse(\SimpleXMLElement $card)
17
    {
18
        return (new self)
19
            ->setAccount((string)$card->account)
20
            ->setCurrency((string)$card->currency)
21
            ->setCardNumber((string)$card->card_number)
22
            ;
23
    }
24
25
    /**
26
     * @param string $account
27
     *
28
     * @return $this
29
     */
30
    public function setAccount($account)
31
    {
32
        $this->account = $account;
33
34
        return $this;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getAccount()
41
    {
42
        return $this->account;
43
    }
44
45
    /**
46
     * @param string $currency
47
     *
48
     * @return $this
49
     */
50
    public function setCurrency($currency)
51
    {
52
        $this->currency = $currency;
53
54
        return $this;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getCurrency()
61
    {
62
        return $this->currency;
63
    }
64
65
    /**
66
     * @param string $cardNumber
67
     *
68
     * @return $this
69
     */
70
    public function setCardNumber($cardNumber)
71
    {
72
        $this->cardNumber = $cardNumber;
73
74
        return $this;
75
    }
76
77
    /**
78
     * @return \DateTime
79
     */
80
    public function getCardNumber()
81
    {
82
        return $this->cardNumber;
83
    }
84
}