DirectPlusResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
A getSubscriberRef() 0 4 1
A getBearer() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Nexylan packages.
5
 *
6
 * (c) Nexylan SAS <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Nexy\PayboxDirect\Response;
13
14
/**
15
 * @author Sullivan Senechal <[email protected]>
16
 */
17
final class DirectPlusResponse extends AbstractResponse
18
{
19
    /**
20
     * @var string
21
     */
22
    private $subscriberRef;
23
24
    /**
25
     * @var string|false false if empty
26
     */
27
    private $bearer;
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function __construct(array $parameters)
33
    {
34
        parent::__construct($parameters);
35
36
        if (!isset($this->filteredParameters['REFABONNE'])) {
37
            throw new \RuntimeException('Undefined index REFABONNE', 1);
38
        }
39
40
        $this->subscriberRef = $this->filteredParameters['REFABONNE'];
41
        $this->bearer = $this->filteredParameters['PORTEUR'];
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getSubscriberRef()
48
    {
49
        return $this->subscriberRef;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getBearer()
56
    {
57
        return $this->bearer;
58
    }
59
}
60