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

AbstractTransactionRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 38
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
namespace Nexy\PayboxDirect\Request;
4
5
abstract class AbstractTransactionRequest extends AbstractRequest
6
{
7
    /**
8
     * @var int
9
     */
10
    private $amount;
11
12
    /**
13
     * @var int|null
14
     */
15
    private $currency = null;
16
17
    /**
18
     * @param int $amount
19
     */
20
    public function __construct($amount)
21
    {
22
        $this->amount = $amount;
23
    }
24
25
    /**
26
     * @param int $currency
27
     */
28
    final public function setCurrency($currency = null)
29
    {
30
        $this->currency = $currency;
31
    }
32
33
    public function getParameters()
34
    {
35
        $parameters = [
36
            'MONTANT' => $this->amount,
37
            'DEVISE' => $this->currency,
38
        ];
39
40
        return array_merge(parent::getParameters(), $parameters);
41
    }
42
}
43