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

AnyCloudFactory::createAdapter()   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 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace AnyCloud\Service\File\Store;
4
5
use AnyCloud\File\Store;
6
use AnyCloud\File\Store\AnyCloud;
0 ignored issues
show
Bug introduced by
The type AnyCloud\File\Store\AnyCloud 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...
7
use AnyCloud\Service\File\Adapter;
0 ignored issues
show
Bug introduced by
The type AnyCloud\Service\File\Adapter 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...
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
12
class AnyCloudFactory implements FactoryInterface
13
{
14
    const SERVICE_NAMES = [
15
        'aws' => Store\Aws::class,
0 ignored issues
show
Bug introduced by
The type AnyCloud\File\Store\Aws 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
        'azure' => Store\Azure::class,
0 ignored issues
show
Bug introduced by
The type AnyCloud\File\Store\Azure 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...
17
        'digital_ocean' => Store\DigitalOcean::class,
0 ignored issues
show
Bug introduced by
The type AnyCloud\File\Store\DigitalOcean 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...
18
        'dropbox' => Store\Dropbox::class,
19
        'google' => Store\Google::class,
0 ignored issues
show
Bug introduced by
The type AnyCloud\File\Store\Google 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...
20
        'scaleway' => Store\Scaleway::class,
0 ignored issues
show
Bug introduced by
The type AnyCloud\File\Store\Scaleway 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...
21
        'wasabi' => Store\Wasabi::class,
0 ignored issues
show
Bug introduced by
The type AnyCloud\File\Store\Wasabi 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
24
    /**
25
     * @param ContainerInterface $serviceLocator
26
     * @param string             $requestedName
27
     * @param array|null         $options
28
     *
29
     * @return AnyCloud|object
30
     */
31
    public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null)
32
    {
33
        $settings = $serviceLocator->get('Omeka\Settings');
34
        $anycloud_adapter = $settings->get('anycloud_adapter', []);
35
        $adapter = $anycloud_adapter['adapter'];
36
37
        if (array_key_exists($adapter, self::SERVICE_NAMES)) {
38
            return $serviceLocator->get(self::SERVICE_NAMES[$adapter]);
39
        }
40
41
        throw new \Omeka\Service\Exception\ConfigException('Bad value for anycloud_adapter: ' . $adapter);
0 ignored issues
show
Bug introduced by
The type Omeka\Service\Exception\ConfigException 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...
42
    }
43
}
44