provideBusinessLayerDependencies()   A
last analyzed

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\Zed\AdyenApi;
9
10
use Spryker\Zed\Kernel\AbstractBundleDependencyProvider;
11
use Spryker\Zed\Kernel\Container;
12
use SprykerEco\Zed\AdyenApi\Dependency\Service\AdyenApiToUtilEncodingServiceBridge;
13
14
class AdyenApiDependencyProvider extends AbstractBundleDependencyProvider
15
{
16
    public const SERVICE_UTIL_ENCODING = 'SERVICE_UTIL_ENCODING';
17
18
    /**
19
     * @param \Spryker\Zed\Kernel\Container $container
20
     *
21
     * @return \Spryker\Zed\Kernel\Container
22
     */
23
    public function provideBusinessLayerDependencies(Container $container): Container
24
    {
25
        $container = parent::provideBusinessLayerDependencies($container);
26
        $container = $this->addUtilEncodingService($container);
27
28
        return $container;
29
    }
30
31
    /**
32
     * @param \Spryker\Zed\Kernel\Container $container
33
     *
34
     * @return \Spryker\Zed\Kernel\Container
35
     */
36
    protected function addUtilEncodingService(Container $container): Container
37
    {
38
        $container[static::SERVICE_UTIL_ENCODING] = function (Container $container) {
39
            return new AdyenApiToUtilEncodingServiceBridge($container->getLocator()->utilEncoding()->service());
40
        };
41
42
        return $container;
43
    }
44
}
45