CrefoPayDependencyProvider::addUtilTextService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Service\CrefoPay;
9
10
use Spryker\Service\Kernel\AbstractBundleDependencyProvider;
11
use Spryker\Service\Kernel\Container;
12
use SprykerEco\Service\CrefoPay\Dependency\Service\CrefoPayToUtilTextServiceBridge;
13
14
/**
15
 * @method \SprykerEco\Service\CrefoPay\CrefoPayConfig getConfig()
16
 */
17
class CrefoPayDependencyProvider extends AbstractBundleDependencyProvider
18
{
19
    /**
20
     * @var string
21
     */
22
    public const SERVICE_UTIL_TEXT = 'SERVICE_UTIL_TEXT';
23
24
    /**
25
     * @param \Spryker\Service\Kernel\Container $container
26
     *
27
     * @return \Spryker\Service\Kernel\Container
28
     */
29
    public function provideServiceDependencies(Container $container): Container
30
    {
31
        $container = parent::provideServiceDependencies($container);
32
        $container = $this->addUtilTextService($container);
33
34
        return $container;
35
    }
36
37
    /**
38
     * @param \Spryker\Service\Kernel\Container $container
39
     *
40
     * @return \Spryker\Service\Kernel\Container
41
     */
42
    protected function addUtilTextService(Container $container): Container
43
    {
44
        $container->set(static::SERVICE_UTIL_TEXT, function (Container $container) {
45
            return new CrefoPayToUtilTextServiceBridge($container->getLocator()->utilText()->service());
46
        });
47
48
        return $container;
49
    }
50
}
51