Completed
Branch master (d9d9e6)
by Thomas Mauro
05:00
created

ConfigProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 41
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 27 1
A getDependencies() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\SentryModule;
6
7
use Sentry\ClientInterface;
8
use Sentry\State\HubInterface;
9
use Zend\ServiceManager\Factory\InvokableFactory;
10
11
final class ConfigProvider
12
{
13 2
    public function __invoke(): array
14
    {
15
        return [
16 2
            'dependencies' => $this->getDependencies(),
17
            'sentry' => [
18
                'options' => [
19
                    'dsn' => '',
20
                ],
21
                'javascript' => [
22
                    'inject_script' => false,
23
                    'script' => [
24
                        'src' => 'https://browser.sentry-cdn.com/5.6.3/bundle.min.js',
25
                        'integrity' => 'sha384-/Cqa/8kaWn7emdqIBLk3AkFMAHBk0LObErtMhO+hr52CntkaurEnihPmqYj3uJho',
26
                        'crossorigin' => 'anonymous',
27
                    ],
28
                    'options' => [
29
                        'dsn' => '',
30
                    ],
31
                ],
32
            ],
33
            'log_writers' => [
34
                'factories' => [
35
                    Log\Writer\Sentry::class => InvokableFactory::class,
36
                ],
37
            ],
38
        ];
39
    }
40
41 3
    public function getDependencies(): array
42
    {
43
        return [
44 3
            'factories' => [
45
                ClientInterface::class => Service\ClientConfigFactory::class,
46
                HubInterface::class => Service\HubFactory::class,
47
                Listener\ErrorHandlerListener::class => Listener\ErrorHandlerListenerFactory::class,
48
            ],
49
        ];
50
    }
51
}
52