Passed
Push — bugfix/sc-7611/bad-transaction... ( 1873c9 )
by Filip
06:21 queued 13s
created

NewRelicTransactionNameHandlerPlugin   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 5
c 1
b 0
f 1
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A provide() 0 3 1
1
<?php
2
3
/**
4
 * Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Service\NewRelic\Plugin;
9
10
use Spryker\Service\Container\ContainerInterface;
11
use Spryker\Shared\ApplicationExtension\Dependency\Plugin\ApplicationPluginInterface;
12
use Spryker\Shared\ApplicationExtension\Dependency\Plugin\BootableApplicationPluginInterface;
13
use Spryker\Zed\Kernel\Communication\AbstractPlugin;
14
15
/**
16
 * @method \SprykerEco\Service\NewRelic\NewRelicServiceInterface getService()
17
 * @method \SprykerEco\Service\NewRelic\NewRelicConfig getConfig()
18
 */
19
class NewRelicTransactionNameHandlerPlugin extends AbstractPlugin implements ApplicationPluginInterface, BootableApplicationPluginInterface
20
{
21
    /**
22
     * @param \Spryker\Service\Container\ContainerInterface $container
23
     *
24
     * @return \Spryker\Service\Container\ContainerInterface
25
     */
26
    public function provide(ContainerInterface $container): ContainerInterface
27
    {
28
        return $container;
29
    }
30
31
    /**
32
     * @param \Spryker\Service\Container\ContainerInterface $container
33
     *
34
     * @return \Spryker\Service\Container\ContainerInterface
35
     */
36
    public function boot(ContainerInterface $container): ContainerInterface
37
    {
38
        $this->getService()
39
            ->setTransactionName($this->getConfig()->getDefaultTransactionName());
40
41
        return $container;
42
    }
43
}
44