Completed
Push — master ( 81f738...fe066f )
by Westin
03:33
created

DropBoxAdapterFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 1
1
<?php
2
declare(strict_types=1);
3
4
namespace WShafer\PSR11FlySystem\Adaptor;
5
6
use Spatie\Dropbox\Client;
7
use Spatie\FlysystemDropbox\DropboxAdapter;
8
use WShafer\PSR11FlySystem\FactoryInterface;
9
10
class DropBoxAdapterFactory implements FactoryInterface
11
{
12 1
    public function __invoke(array $options)
13
    {
14 1
        $token = $options['token'] ?? '';
15 1
        $prefix = $options['prefix'] ?? '';
16
17 1
        $client = new Client($token);
18 1
        return new DropboxAdapter($client, $prefix);
19
    }
20
}
21