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

AnyCloudFactory::createAwsAdapter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace AnyCloud\Service\File\Store;
4
5
use AnyCloud\File\Store;
6
use Interop\Container\ContainerInterface;
7
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...
8
9
class AnyCloudFactory implements FactoryInterface
10
{
11
    const SERVICE_NAMES = [
12
        '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...
13
        '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...
14
        '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...
15
        'dropbox'       => Store\Dropbox::class,
16
        '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...
17
        '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...
18
        '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...
19
    ];
20
21
    /**
22
     * @param ContainerInterface $serviceLocator
23
     * @param string             $requestedName
24
     * @param array|null         $options
25
     *
26
     * @return \Omeka\File\Store\StoreInterface
27
     */
28
    public function __invoke(ContainerInterface $serviceLocator, $requestedName, array $options = null)
29
    {
30
        $settings = $serviceLocator->get('Omeka\Settings');
31
        $anycloud_adapter = $settings->get('anycloud_adapter', []);
32
        $adapter = $anycloud_adapter['adapter'];
33
34
        if (array_key_exists($adapter, self::SERVICE_NAMES)) {
35
            return $serviceLocator->get(self::SERVICE_NAMES[$adapter]);
36
        }
37
38
        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...
39
    }
40
}
41