Completed
Push — master ( fe066f...e529fe )
by Westin
02:18
created

AdaptorMapper   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 0
loc 26
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
C getFactoryClassName() 0 23 8
1
<?php
2
declare(strict_types=1);
3
4
namespace WShafer\PSR11FlySystem\Adaptor;
5
6
use WShafer\PSR11FlySystem\MapperAbstract;
7
8
class AdaptorMapper extends MapperAbstract
9
{
10 8
    public function getFactoryClassName(string $type)
11
    {
12 8
        if (class_exists($type)) {
13 1
            return $type;
14
        }
15
16
        switch ($type) {
17 7
            case 'dropbox':
18 1
                return DropBoxAdapterFactory::class;
19 6
            case 's3':
20 1
                return S3AdapterFactory::class;
21 5
            case 'azure':
22 1
                return AzureAdapterFactory::class;
23 4
            case 'ftp':
24 1
                return FtpAdaptorFactory::class;
25 3
            case 'local':
26 1
                return LocalAdaptorFactory::class;
27 2
            case 'null':
28 1
                return NullAdaptorFactory::class;
29
        }
30
31 1
        return null;
32
    }
33
}
34