Passed
Push — master ( d2a5be...42531d )
by Jared
02:39 queued 13s
created

AzureFactory::getConfigKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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