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

InquiryResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
A getStatus() 0 4 1
A getDiscount() 0 4 1
1
<?php
2
3
namespace Nexy\PayboxDirect\Response;
4
5
/**
6
 * Special response for inquiry request.
7
 *
8
 * @author Sullivan Senechal <[email protected]>
9
 */
10
final class InquiryResponse extends AbstractResponse
11
{
12
    /**
13
     * @var string
14
     */
15
    private $status;
16
17
    /**
18
     * @var string|null
19
     */
20
    private $discount = null;
21
22
    public function __construct($data)
23
    {
24
        parent::__construct($data);
25
26
        $this->status = $data['STATUS'];
27
28
        if (array_key_exists('REMISE', $data)) {
29
            $this->discount = $data['REMISE'];
30
        }
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getStatus()
37
    {
38
        return $this->status;
39
    }
40
41
    /**
42
     * @return string|null
43
     */
44
    public function getDiscount()
45
    {
46
        return $this->discount;
47
    }
48
}
49