addUtilEncodingService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 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\Zed\Easycredit;
9
10
use Spryker\Zed\Kernel\AbstractBundleDependencyProvider;
11
use Spryker\Zed\Kernel\Container;
12
use Spryker\Zed\Money\Communication\Plugin\MoneyPlugin;
13
use SprykerEco\Service\Easycredit\Dependency\Service\EasycreditToUtilEncodingServiceBridge;
14
15
class EasycreditDependencyProvider extends AbstractBundleDependencyProvider
16
{
17
    public const SERVICE_UTIL_ENCODING = 'SERVICE_UTIL_ENCODING';
18
    public const PLUGIN_MONEY = 'PLUGIN_MONEY';
19
20
    /**
21
     * @param \Spryker\Zed\Kernel\Container $container
22
     *
23
     * @return \Spryker\Zed\Kernel\Container
24
     */
25
    public function provideBusinessLayerDependencies(Container $container): Container
26
    {
27
        $container = $this->addUtilEncodingService($container);
28
        $container = $this->addPluginMoney($container);
29
30
        return $container;
31
    }
32
33
    /**
34
     * @param \Spryker\Zed\Kernel\Container $container
35
     *
36
     * @return \Spryker\Zed\Kernel\Container
37
     */
38
    protected function addUtilEncodingService(Container $container): Container
39
    {
40
        $container[static::SERVICE_UTIL_ENCODING] = function (Container $container) {
41
            return new EasycreditToUtilEncodingServiceBridge($container->getLocator()->utilEncoding()->service());
42
        };
43
44
        return $container;
45
    }
46
47
    /**
48
     * @param \Spryker\Zed\Kernel\Container $container
49
     *
50
     * @return \Spryker\Zed\Kernel\Container
51
     */
52
    protected function addPluginMoney(Container $container): Container
53
    {
54
        $container[static::PLUGIN_MONEY] = function () {
55
            return new MoneyPlugin();
56
        };
57
58
        return $container;
59
    }
60
}
61