Passed
Pull Request — master (#13)
by Andrey
14:51 queued 07:35
created

provideServiceDependencies()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
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
    public const SERVICE_UTIL_TEXT = 'SERVICE_UTIL_TEXT';
17
18
    /**
19
     * @param \Spryker\Service\Kernel\Container $container
20
     *
21
     * @return \Spryker\Service\Kernel\Container
22
     */
23
    public function provideServiceDependencies(Container $container): Container
24
    {
25
        $container = parent::provideServiceDependencies($container);
26
        $container = $this->addUtilTextService($container);
27
28
        return $container;
29
    }
30
31
    /**
32
     * @param \Spryker\Service\Kernel\Container $container
33
     *
34
     * @return \Spryker\Service\Kernel\Container
35
     */
36
    protected function addUtilTextService(Container $container): Container
37
    {
38
        $container->set(static::SERVICE_UTIL_TEXT, function (Container $container) {
39
            return new CrefoPayToUtilTextServiceBridge($container->getLocator()->utilText()->service());
40
        });
41
42
        return $container;
43
    }
44
}
45