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

InquiryResponse::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 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