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

AbstractTransactionRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
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 40
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setCurrency() 0 4 1
A getParameters() 0 9 1
1
<?php
2
3
4
namespace Nexy\PayboxDirect\Request;
5
6
7
abstract class AbstractTransactionRequest extends AbstractRequest
8
{
9
    /**
10
     * @var int
11
     */
12
    private $amount;
13
14
    /**
15
     * @var int|null
16
     */
17
    private $currency = null;
18
19
    /**
20
     * @param int $amount
21
     */
22
    public function __construct($amount)
23
    {
24
        $this->amount = $amount;
25
    }
26
27
    /**
28
     * @param int $currency
29
     */
30
    final public function setCurrency($currency = null)
31
    {
32
        $this->currency = $currency;
33
    }
34
35
    public function getParameters()
36
    {
37
        $parameters = [
38
            'MONTANT' => $this->amount,
39
            'DEVISE' => $this->currency,
40
        ];
41
42
        return array_merge(parent::getParameters(), $parameters);
43
    }
44
45
46
}
47