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

AbstractTransactionRequest::setCurrency()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 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