DropBoxAdapterFactory::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 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