Passed
Pull Request — master (#42)
by
unknown
08:12 queued 05:35
created

AzureFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigKey() 0 3 1
A getFilesystemAdapter() 0 11 1
1
<?php
2
3
namespace AnyCloud\Service\File\Store;
4
5
use League\Flysystem\AzureBlobStorage\AzureBlobStorageAdapter;
6
use MicrosoftAzure\Storage\Blob\BlobRestProxy;
7
8
class AzureFactory extends AbstractFlysystemFactory
9
{
10
    protected function getConfigKey(): string
11
    {
12
        return 'azure';
13
    }
14
15
    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...
16
    {
17
        $connectionString = sprintf(
18
            'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s;',
19
            $config['account_name'],
20
            $config['account_key']
21
        );
22
        $client = BlobRestProxy::createBlobService($connectionString);
23
        $adapter = new AzureBlobStorageAdapter($client, $config['container_name']);
24
25
        return $adapter;
26
    }
27
}
28