Passed
Pull Request — master (#2)
by Andreas
11:41
created

CancelTransaction::getExtraOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Larium\Pay\Transaction;
6
7
use Larium\Pay\ParamsBag;
8
9
class CancelTransaction implements Cancel
10
{
11
    use Commit;
12
13
    private $id;
14
15
    private $extraOptions;
16
17 1
    public function __construct($id, array $extraOptions = [])
18
    {
19 1
        $this->id = $id;
20 1
        $this->extraOptions = new ParamsBag($extraOptions);
21
    }
22
23
    public function getId()
24
    {
25
        return $this->id;
26
    }
27
28 1
    public function canCommit()
29
    {
30 1
        return $this->id !== null;
31
    }
32
33
    public function getExtraOptions()
34
    {
35
        return $this->extraOptions;
36
    }
37
}
38