CrefoPayDependencyProvider   A
last analyzed

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 provideDependencies() 0 6 1
A addCrefoPayApiService() 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\Yves\CrefoPay;
9
10
use Spryker\Yves\Kernel\AbstractBundleDependencyProvider;
11
use Spryker\Yves\Kernel\Container;
12
use SprykerEco\Yves\CrefoPay\Dependency\Service\CrefoPayToCrefoPayApiServiceBridge;
13
14
/**
15
 * @method \SprykerEco\Yves\CrefoPay\CrefoPayConfig getConfig()
16
 */
17
class CrefoPayDependencyProvider extends AbstractBundleDependencyProvider
18
{
19
    /**
20
     * @var string
21
     */
22
    public const SERVICE_CREFO_PAY_API = 'SERVICE_CREFO_PAY_API';
23
24
    /**
25
     * @param \Spryker\Yves\Kernel\Container $container
26
     *
27
     * @return \Spryker\Yves\Kernel\Container
28
     */
29
    public function provideDependencies(Container $container): Container
30
    {
31
        $container = parent::provideDependencies($container);
32
        $container = $this->addCrefoPayApiService($container);
33
34
        return $container;
35
    }
36
37
    /**
38
     * @param \Spryker\Yves\Kernel\Container $container
39
     *
40
     * @return \Spryker\Yves\Kernel\Container
41
     */
42
    protected function addCrefoPayApiService(Container $container): Container
43
    {
44
        $container->set(static::SERVICE_CREFO_PAY_API, function (Container $container) {
45
            return new CrefoPayToCrefoPayApiServiceBridge($container->getLocator()->crefoPayApi()->service());
46
        });
47
48
        return $container;
49
    }
50
}
51