Completed
Push — master ( e8b86c...279d13 )
by Sullivan
02:12
created

AbstractTransactionRequest   A

Complexity

Total Complexity 3

Size/Duplication

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getParameters() 0 9 1
A setCurrency() 0 6 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
     * @return $this
29
     */
30
    final public function setCurrency($currency = null)
31
    {
32
        $this->currency = $currency;
33
34
        return $this;
35
    }
36
37
    public function getParameters()
38
    {
39
        $parameters = [
40
            'MONTANT' => $this->amount,
41
            'DEVISE' => $this->currency,
42
        ];
43
44
        return array_merge(parent::getParameters(), $parameters);
45
    }
46
}
47