Completed
Push — master ( 4dc014...648604 )
by Sullivan
02:36
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
    /**
23
     * {@inheritdoc}
24
     */
25
    public function __construct($parameters)
26
    {
27
        parent::__construct($parameters);
28
29
        $this->status = $this->filteredParameters['STATUS'];
30
31
        if (array_key_exists('REMISE', $this->filteredParameters)) {
32
            $this->discount = $this->filteredParameters['REMISE'];
33
        }
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getStatus()
40
    {
41
        return $this->status;
42
    }
43
44
    /**
45
     * @return string|null
46
     */
47
    public function getDiscount()
48
    {
49
        return $this->discount;
50
    }
51
}
52