Passed
Pull Request — feature/eco-3656/dev-paypal-ex... (#40)
by
unknown
07:17
created

ComputopDependencyProvider::addShipmentClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Client\Computop;
9
10
use Spryker\Client\Kernel\AbstractDependencyProvider;
11
use Spryker\Client\Kernel\Container;
12
13
class ComputopDependencyProvider extends AbstractDependencyProvider
14
{
15
    public const CLIENT_ZED_REQUEST = 'CLIENT_ZED_REQUEST';
16
    public const CLIENT_SHIPMENT = 'CLIENT_SHIPMENT';
17
18
    /**
19
     * @param \Spryker\Client\Kernel\Container $container
20
     *
21
     * @return \Spryker\Client\Kernel\Container
22
     */
23
    public function provideServiceLayerDependencies(Container $container): Container
24
    {
25
        $container = $this->addZedRequestClient($container);
26
        $container = $this->addShipmentClient($container);
27
28
        return $container;
29
    }
30
31
    /**
32
     * @param \Spryker\Client\Kernel\Container $container
33
     *
34
     * @return \Spryker\Client\Kernel\Container
35
     */
36
    protected function addZedRequestClient(Container $container): Container
37
    {
38
        $container->set(static::CLIENT_ZED_REQUEST, function (Container $container) {
39
            return $container->getLocator()->zedRequest()->client();
40
        });
41
42
        return $container;
43
    }
44
45
    /**
46
     * @param \Spryker\Client\Kernel\Container $container
47
     *
48
     * @return \Spryker\Client\Kernel\Container
49
     */
50
    protected function addShipmentClient(Container $container): Container
51
    {
52
        $container->set(static::CLIENT_SHIPMENT, function (Container $container) {
53
            return $container->getLocator()->shipment()->client();
54
        });
55
56
        return $container;
57
    }
58
}
59