Completed
Pull Request — master (#32)
by Sullivan
02:30
created

AbstractResponse   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 107
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 8
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 107
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getCode() 0 4 1
A getComment() 0 4 1
A getSite() 0 4 1
A getRank() 0 4 1
A getCallNumber() 0 4 1
A getQuestionNumber() 0 4 1
A getTransactionNumber() 0 4 1
1
<?php
2
3
namespace Nexy\PayboxDirect\Response;
4
5
/**
6
 * @author Sullivan Senechal <[email protected]>
7
 */
8
abstract class AbstractResponse implements ResponseInterface
9
{
10
    /**
11
     * @var int
12
     */
13
    private $code;
14
15
    /**
16
     * @var string
17
     */
18
    private $comment;
19
20
    /**
21
     * @var string
22
     */
23
    private $site;
24
25
    /**
26
     * @var string
27
     */
28
    private $rank;
29
30
    /**
31
     * @var int
32
     */
33
    private $callNumber;
34
35
    /**
36
     * @var int
37
     */
38
    private $questionNumber;
39
40
    /**
41
     * @var int
42
     */
43
    private $transactionNumber;
44
45
    /**
46
     * @param string[] $data
47
     */
48
    public function __construct(array $data)
49
    {
50
        $this->code = intval($data['CODEREPONSE']);
51
        $this->comment = $data['COMMENTAIRE'];
52
        $this->site = $data['SITE'];
53
        $this->rank = $data['RANG'];
54
        $this->callNumber = intval($data['NUMAPPEL']);
55
        $this->questionNumber = intval($data['NUMQUESTION']);
56
        $this->transactionNumber = intval($data['NUMTRANS']);
57
    }
58
59
    /**
60
     * @return int
61
     */
62
    public function getCode()
63
    {
64
        return $this->code;
65
    }
66
67
    /**
68
     * @return string
69
     */
70
    public function getComment()
71
    {
72
        return $this->comment;
73
    }
74
75
    /**
76
     * @return string
77
     */
78
    public function getSite()
79
    {
80
        return $this->site;
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getRank()
87
    {
88
        return $this->rank;
89
    }
90
91
    /**
92
     * @return int
93
     */
94
    public function getCallNumber()
95
    {
96
        return $this->callNumber;
97
    }
98
99
    /**
100
     * @return int
101
     */
102
    public function getQuestionNumber()
103
    {
104
        return $this->questionNumber;
105
    }
106
107
    /**
108
     * @return int
109
     */
110
    public function getTransactionNumber()
111
    {
112
        return $this->transactionNumber;
113
    }
114
}
115