Passed
Branch feature/ECO-573-per-item-proce... (fe5bf4)
by Andrey
04:56
created

AmazonpayDependencyProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 48
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B provideDependencies() 0 33 1
1
<?php
2
3
/**
4
 * Apache OSL-2
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Yves\Amazonpay;
9
10
use Spryker\Yves\Kernel\AbstractBundleDependencyProvider;
11
use Spryker\Yves\Kernel\Container;
12
use SprykerEco\Zed\Amazonpay\Dependency\Client\AmazonpayToCalculationBridge;
13
use SprykerEco\Zed\Amazonpay\Dependency\Client\AmazonpayToCheckoutBridge;
14
use SprykerEco\Zed\Amazonpay\Dependency\Client\AmazonpayToCustomerBridge;
15
use SprykerEco\Zed\Amazonpay\Dependency\Client\AmazonpayToQuoteBridge;
16
use SprykerEco\Zed\Amazonpay\Dependency\Client\AmazonpayToShipmentBridge;
17
18
class AmazonpayDependencyProvider extends AbstractBundleDependencyProvider
19
{
20
21
    const CLIENT_QUOTE = 'cart client';
22
    const CLIENT_SHIPMENT = 'shipment client';
23
    const CLIENT_CHECKOUT = 'checkout client';
24
    const CLIENT_CUSTOMER = 'customer client';
25
    const CLIENT_CALCULATION = 'calculation client';
26
    const PLUGIN_CHECKOUT_BREADCRUMB = 'plugin checkout breadcrumb';
27
28
    /**
29
     * @param \Spryker\Yves\Kernel\Container $container
30
     *
31
     * @return \Spryker\Yves\Kernel\Container
32
     */
33
    public function provideDependencies(Container $container)
34
    {
35
        $container[self::CLIENT_QUOTE] = function () use ($container) {
36
            return new AmazonpayToQuoteBridge(
37
                $container->getLocator()->quote()->client()
38
            );
39
        };
40
41
        $container[self::CLIENT_SHIPMENT] = function () use ($container) {
42
            return new AmazonpayToShipmentBridge(
43
                $container->getLocator()->shipment()->client()
44
            );
45
        };
46
47
        $container[self::CLIENT_CHECKOUT] = function () use ($container) {
48
            return new AmazonpayToCheckoutBridge(
49
                $container->getLocator()->checkout()->client()
50
            );
51
        };
52
53
        $container[self::CLIENT_CALCULATION] = function () use ($container) {
54
            return new AmazonpayToCalculationBridge(
55
                $container->getLocator()->calculation()->client()
56
            );
57
        };
58
59
        $container[self::CLIENT_CUSTOMER] = function () use ($container) {
60
            return new AmazonpayToCustomerBridge(
61
                $container->getLocator()->customer()->client()
62
            );
63
        };
64
65
        return $container;
66
    }
67
68
}
69