Completed
Push — master ( 8c4272...ef6d68 )
by Thomas Mauro
11s
created

StackTraceFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 4
dl 0
loc 22
ccs 11
cts 11
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 19 3
1
<?php
2
declare(strict_types=1);
3
4
namespace Facile\SentryModule\Service;
5
6
use Facile\Sentry\Common\StackTrace\StackTrace;
7
use Facile\Sentry\Common\StackTrace\StackTraceInterface;
8
use Facile\SentryModule\Options\ConfigurationInterface;
9
use Interop\Container\ContainerInterface;
10
use Raven_Client;
11
12
class StackTraceFactory
13
{
14 1
    public function __invoke(ContainerInterface $container): StackTraceInterface
15
    {
16
        /** @var Raven_Client $client */
17 1
        $client = $container->get(Raven_Client::class);
18
        /** @var ConfigurationInterface $configuration */
19 1
        $configuration = $container->get(ConfigurationInterface::class);
20
21 1
        $serializer = $container->has(\Raven_Serializer::class) ? $container->get(\Raven_Serializer::class) : null;
22 1
        $reprSerializer = $container->has(\Raven_ReprSerializer::class) ? $container->get(\Raven_ReprSerializer::class) : null;
23
24 1
        $stackTrace = new StackTrace(
25 1
            $client,
26 1
            $serializer,
27 1
            $reprSerializer,
28 1
            $configuration->getStackTraceOptions()->getIgnoreBacktraceNamespaces()
29
        );
30
31 1
        return $stackTrace;
32
    }
33
}
34