Test Failed
Push — master ( 751b74...30bdfb )
by Julien
11:52
created

ServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
dl 0
loc 21
ccs 0
cts 5
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
1
<?php
2
/**
3
 * This file is part of the Zemit Framework.
4
 *
5
 * (c) Zemit Team <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE.txt
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Zemit\Provider\Aws;
12
13
use Aws\Sdk;
0 ignored issues
show
Bug introduced by
The type Aws\Sdk 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
use Zemit\Cache;
15
use Phalcon\Cache\AdapterFactory;
16
use Phalcon\Storage\SerializerFactory;
17
use Zemit\Provider\AbstractServiceProvider;
18
19
/**
20
 * Class ServiceProvider
21
 *
22
 * @link https://docs.aws.amazon.com/aws-sdk-php/v3/api/index.html
23
 *
24
 * @author Julien Turbide <[email protected]>
25
 * @copyright Zemit Team <[email protected]>
26
 *
27
 * @since 1.0
28
 * @version 1.0
29
 *
30
 * @package Zemit\Provider\ModelsCache
31
 */
32
class ServiceProvider extends AbstractServiceProvider
33
{
34
    /**
35
     * The Service name.
36
     * @var string
37
     */
38
    protected $serviceName = 'aws';
39
    
40
    /**
41
     * {@inheritdoc}
42
     *
43
     * @return void
44
     */
45
    public function register(\Phalcon\Di\DiInterface $di): void
46
    {
47
        $di->setShared($this->getName(), function() use ($di) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
48
            
49
            $config = $di->get('config')->aws;
50
            $options = $config->toArray();
51
            
52
            return new Sdk($options);
53
        });
54
    }
55
}
56