Passed
Pull Request — master (#13)
by Ihor
23:46 queued 19:52
created

CrefoPayDependencyProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addUtilTextService() 0 7 1
A provideServiceDependencies() 0 6 1
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
class CrefoPayDependencyProvider extends AbstractBundleDependencyProvider
15
{
16
    /**
17
     * @var string
18
     */
19
    public const SERVICE_UTIL_TEXT = 'SERVICE_UTIL_TEXT';
20
21
    /**
22
     * @param \Spryker\Service\Kernel\Container $container
23
     *
24
     * @return \Spryker\Service\Kernel\Container
25
     */
26
    public function provideServiceDependencies(Container $container): Container
27
    {
28
        $container = parent::provideServiceDependencies($container);
29
        $container = $this->addUtilTextService($container);
30
31
        return $container;
32
    }
33
34
    /**
35
     * @param \Spryker\Service\Kernel\Container $container
36
     *
37
     * @return \Spryker\Service\Kernel\Container
38
     */
39
    protected function addUtilTextService(Container $container): Container
40
    {
41
        $container->set(static::SERVICE_UTIL_TEXT, function (Container $container) {
42
            return new CrefoPayToUtilTextServiceBridge($container->getLocator()->utilText()->service());
43
        });
44
45
        return $container;
46
    }
47
}
48