RedisWalletFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
c 0
b 0
f 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Damax\ChargeableApi\Wallet;
6
7
use Damax\ChargeableApi\Identity\Identity;
8
use Predis\ClientInterface;
9
10
final class RedisWalletFactory implements WalletFactory
11
{
12
    private $client;
13
    private $walletKey;
14
15
    public function __construct(ClientInterface $client, string $walletKey)
16
    {
17
        $this->client = $client;
18
        $this->walletKey = $walletKey;
19
    }
20
21
    public function create(Identity $identity): Wallet
22
    {
23
        return new RedisWallet($this->client, $this->walletKey, (string) $identity);
24
    }
25
}
26