Passed
Pull Request — master (#42)
by
unknown
15:10
created

DropboxFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getStore() 0 7 1
A getFilesystemAdapter() 0 6 1
A getConfigKey() 0 3 1
1
<?php
2
3
namespace AnyCloud\Service\File\Store;
4
5
use AnyCloud\DropboxTemporaryUrlGenerator;
0 ignored issues
show
Bug introduced by
The type AnyCloud\DropboxTemporaryUrlGenerator was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use AnyCloud\File\Store\Dropbox;
7
use AnyCloud\FilesystemAdapter\DropboxAdapter;
8
use Interop\Container\ContainerInterface;
9
use Laminas\ServiceManager\Factory\FactoryInterface;
0 ignored issues
show
Bug introduced by
The type Laminas\ServiceManager\Factory\FactoryInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use League\Flysystem\Filesystem;
11
use Omeka\File\Store\StoreInterface;
12
use Spatie\Dropbox\Client;
13
14
class DropboxFactory implements FactoryInterface
15
{
16
    protected function getConfigKey(): string
17
    {
18
        return 'dropbox';
19
    }
20
21
    protected function getFilesystemAdapter(array $config): FilesystemAdapter
0 ignored issues
show
Bug introduced by
The type AnyCloud\Service\File\Store\FilesystemAdapter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
22
    {
23
        $client = new Client($config['access_token']);
24
        $adapter = new DropboxAdapter($client);
25
26
        return $adapter;
27
    }
28
29
    protected function getStore(array $config): StoreInterface
30
    {
31
        $adapter = $this->getFilesystemAdapter($config);
32
        $filesystem = new Filesystem($adapter);
33
        $store = new Dropbox($filesystem);
34
35
        return $store;
36
    }
37
}
38