Module   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 28
ccs 10
cts 10
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getServiceConfig() 0 22 2
1
<?php
2
3
namespace GetStream\Zend;
4
5
use Zend\ModuleManager\Feature\ServiceProviderInterface;
6
7
use GetStream\Stream\Client;
8
use Psr\Container\ContainerInterface;
9
10
class Module implements ServiceProviderInterface
11
{
12
    /**
13
     * @return array
14
     */
15 4
    public function getServiceConfig()
16
    {
17
        return [
18 4
            'factories' => [
19 4
                Client::class => function (ContainerInterface $container) {
20 2
                    $config = $container->get('config');
21
22 2
                    if (isset($config['stream']['url'])) {
23 1
                        return Client::herokuConnect($config['stream']['url']);
24
                    }
25
26 1
                    return new Client(
27 1
                        $config['stream']['app_key'],
28 1
                        $config['stream']['app_secret']
29
                    );
30 4
                },
31
            ],
32
            'shared' => [
33
                Client::class => true,
34
            ],
35
        ];
36
    }
37
}
38