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

ConfigProvider::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 27

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 27
ccs 2
cts 2
cp 1
rs 9.488
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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