Completed
Push — master ( fef7a6...aff413 )
by Arne
02:38
created

LockAdapterFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A requiresInstanceOf() 0 4 1
A getFactoryMap() 0 11 1
1
<?php
2
3
namespace Archivr\LockAdapter;
4
5
use Archivr\AbstractFactory;
6
use Archivr\StorageDriver\StorageDriverInterface;
7
use Archivr\VaultConfiguration;
8
9
final class LockAdapterFactory extends AbstractFactory
10
{
11
    protected static function requiresInstanceOf(): string
12
    {
13
        return LockAdapterInterface::class;
14
    }
15
16
    protected static function getFactoryMap(): array
17
    {
18
        $return = [];
19
20
        $return['storage'] = function(VaultConfiguration $vaultConfiguration, StorageDriverInterface $storageDriver)
21
        {
22
            return new StorageBasedLockAdapter($storageDriver);
23
        };
24
25
        return $return;
26
    }
27
}
28