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

LockAdapterFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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