EasycreditDependencyProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 12
c 2
b 0
f 0
dl 0
loc 44
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A provideBusinessLayerDependencies() 0 6 1
A addUtilEncodingService() 0 7 1
A addPluginMoney() 0 7 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