Statements   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 105
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 9
lcom 1
cbo 1
dl 0
loc 105
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A fromResponse() 0 9 1
A setStatus() 0 6 1
A getStatus() 0 4 1
A setDebet() 0 6 1
A getDebet() 0 4 1
A setCredit() 0 6 1
A getCredit() 0 4 1
A setStatements() 0 6 1
A getStatements() 0 4 1
1
<?php
2
3
namespace Mukhin\PrivatbankBundle\Model;
4
5
class Statements
6
{
7
    /** @var string */
8
    protected $status;
9
10
    /** @var float */
11
    protected $credit;
12
13
    /** @var float */
14
    protected $debet;
15
16
    /** @var Statement[] */
17
    protected $statements = [];
18
19
    public static function fromResponse(\SimpleXMLElement $statements)
20
    {
21
        return (new self)
22
            ->setStatus((string)$statements['status'])
23
            ->setCredit(floatval((string)$statements['credit']))
24
            ->setDebet(floatval((string)$statements['debet']))
25
            ->setStatements(Statement::arrayFromResponse($statements))
26
        ;
27
    }
28
29
    /**
30
     * @param string $status
31
     *
32
     * @return $this
33
     */
34
    public function setStatus($status)
35
    {
36
        $this->status = $status;
37
38
        return $this;
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getStatus()
45
    {
46
        return $this->status;
47
    }
48
49
    /**
50
     * @param float $debet
51
     *
52
     * @return $this
53
     */
54
    public function setDebet($debet)
55
    {
56
        $this->debet = $debet;
57
58
        return $this;
59
    }
60
61
    /**
62
     * @return float
63
     */
64
    public function getDebet()
65
    {
66
        return $this->debet;
67
    }
68
69
    /**
70
     * @param float $credit
71
     *
72
     * @return $this
73
     */
74
    public function setCredit($credit)
75
    {
76
        $this->credit = $credit;
77
78
        return $this;
79
    }
80
81
    /**
82
     * @return float
83
     */
84
    public function getCredit()
85
    {
86
        return $this->credit;
87
    }
88
89
    /**
90
     * @param Statement[] $statements
91
     *
92
     * @return $this
93
     */
94
    public function setStatements($statements)
95
    {
96
        $this->statements = $statements;
97
98
        return $this;
99
    }
100
101
    /**
102
     * @return Statement[]
103
     */
104
    public function getStatements()
105
    {
106
        return $this->statements;
107
    }
108
109
}