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

NewRelicTransactionNameHandlerPlugin::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 6
rs 10
cc 1
nc 1
nop 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