Completed
Pull Request — master (#12)
by Sullivan
02:14
created

DebitRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getRequestId() 0 4 1
A getParameters() 0 9 1
1
<?php
2
3
4
namespace Nexy\PayboxDirect\Request;
5
6
/**
7
 * @author Sullivan Senechal <[email protected]>
8
 */
9
final class DebitRequest extends AbstractReferencedTransactionRequest
10
{
11
    /**
12
     * @var int
13
     */
14
    private $transactionNumber;
15
16
    /**
17
     * @var int
18
     */
19
    private $callNumber;
20
21
    /**
22
     * @param int $reference
23
     * @param int $amount
24
     * @param int $transactionNumber
25
     * @param int $callNumber
26
     */
27
    public function __construct($reference, $amount, $transactionNumber, $callNumber)
28
    {
29
        parent::__construct($reference, $amount);
30
31
        $this->transactionNumber = $transactionNumber;
32
        $this->callNumber = $callNumber;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getRequestId()
39
    {
40
        return RequestInterface::DEBIT;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getParameters()
47
    {
48
        $parameters = [
49
            'NUMTRANS' => $this->transactionNumber,
50
            'NUMAPPEL' => $this->callNumber,
51
        ];
52
53
        return array_merge(parent::getParameters(), $parameters);
54
    }
55
56
57
}
58