Passed
Pull Request — master (#41)
by Dmitrii
15:49
created

HelloSprykerDependencyProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provideServiceLayerDependencies() 0 5 1
A addZedRequestClient() 0 7 1
1
<?php
2
3
namespace Pyz\Client\HelloSpryker;
4
5
use Spryker\Client\Kernel\AbstractDependencyProvider;
6
use Spryker\Client\Kernel\Container;
7
8
class HelloSprykerDependencyProvider extends AbstractDependencyProvider
9
{
10
    public const CLIENT_ZED_REQUEST = 'CLIENT_ZED_REQUEST';
11
12
    /**
13
     * @param \Spryker\Client\Kernel\Container $container
14
     *
15
     * @return \Spryker\Client\Kernel\Container
16
     */
17
    public function provideServiceLayerDependencies(Container $container): Container
18
    {
19
        $container = $this->addZedRequestClient($container);
20
21
        return $container;
22
    }
23
24
    /**
25
     * @param \Spryker\Client\Kernel\Container $container
26
     *
27
     * @return \Spryker\Client\Kernel\Container
28
     */
29
    protected function addZedRequestClient(Container $container): Container
30
    {
31
        $container->set(static::CLIENT_ZED_REQUEST, function (Container $container) {
32
            return $container->getLocator()->zedRequest()->client();
33
        });
34
35
        return $container;
36
    }
37
}
38