Completed
Push — master ( eaf845...272b76 )
by Oleksandr
13s queued 10s
created

addCrefoPayApiService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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