Completed
Pull Request — master (#3)
by
unknown
02:10
created

DropBoxAdapterFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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
    public function __invoke(array $options)
13
    {
14
        $token = $options['token'] ?? '';
15
        $prefix = $options['prefix'] ?? '';
16
17
        $client = new Client($token);
18
        return new DropboxAdapter($client, $prefix);
19
    }
20
}
21