Transaction::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Redis\Business\Model\Transaction;
6
7
8
use Xervice\DataProvider\Business\Model\DataProvider\AbstractDataProvider;
9
10
class Transaction implements TransactionInterface
11
{
12
    /**
13
     * @var string
14
     */
15
    private $key;
16
17
    /**
18
     * @var AbstractDataProvider
19
     */
20
    private $dataProvider;
21
22
    /**
23
     * Transaction constructor.
24
     *
25
     * @param string $key
26
     * @param \Xervice\DataProvider\Business\Model\DataProvider\AbstractDataProvider $dataProvider
27
     */
28 1
    public function __construct(string $key, AbstractDataProvider $dataProvider)
29
    {
30 1
        $this->key = $key;
31 1
        $this->dataProvider = $dataProvider;
32 1
    }
33
34
    /**
35
     * @return string
36
     */
37 1
    public function getKey(): string
38
    {
39 1
        return $this->key;
40
    }
41
42
    /**
43
     * @return \Xervice\DataProvider\Business\Model\DataProvider\AbstractDataProvider
44
     */
45 1
    public function getDataProvider(): AbstractDataProvider
46
    {
47 1
        return $this->dataProvider;
48
    }
49
}
50