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

DirectPlusResponse   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 7 2
A getSubscriberRef() 0 4 1
A getBearer() 0 4 1
1
<?php
2
3
namespace Nexy\PayboxDirect\Response;
4
5
/**
6
 * @author Sullivan Senechal <[email protected]>
7
 */
8
final class DirectPlusResponse extends AbstractResponse
9
{
10
    /**
11
     * @var string
12
     */
13
    private $subscriberRef;
14
15
    /**
16
     * @var string|false False if empty.
17
     */
18
    private $bearer;
19
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function __construct(array $data)
24
    {
25
        parent::__construct($data);
26
27
        $this->subscriberRef = $data['REFABONNE'];
28
        $this->bearer = '' === $data['PORTEUR'] ? false : $data['PORTEUR'];
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getSubscriberRef()
35
    {
36
        return $this->subscriberRef;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getBearer()
43
    {
44
        return $this->bearer;
45
    }
46
}
47