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

DebitRequest   A

Complexity

Total Complexity 3

Size/Duplication

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