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

AbstractResponse   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 79
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getCode() 0 4 1
A getComment() 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 int
22
     */
23
    private $callNumber;
24
25
    /**
26
     * @var int
27
     */
28
    private $questionNumber;
29
30
    /**
31
     * @var int
32
     */
33
    private $transactionNumber;
34
35
    /**
36
     * @param string[] $data
37
     */
38
    public function __construct(array $data)
39
    {
40
        $this->code = intval($data['CODEREPONSE']);
41
        $this->comment = $data['COMMENTAIRE'];
42
        $this->callNumber = intval($data['NUMAPPEL']);
43
        $this->questionNumber = intval($data['NUMQUESTION']);
44
        $this->transactionNumber = intval($data['NUMTRANS']);
45
    }
46
47
    /**
48
     * @return int
49
     */
50
    public function getCode()
51
    {
52
        return $this->code;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getComment()
59
    {
60
        return $this->comment;
61
    }
62
63
    /**
64
     * @return int
65
     */
66
    public function getCallNumber()
67
    {
68
        return $this->callNumber;
69
    }
70
71
    /**
72
     * @return int
73
     */
74
    public function getQuestionNumber()
75
    {
76
        return $this->questionNumber;
77
    }
78
79
    /**
80
     * @return int
81
     */
82
    public function getTransactionNumber()
83
    {
84
        return $this->transactionNumber;
85
    }
86
}
87