FactFinderNgDependencyProvider   A
last analyzed

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 provideCommunicationLayerDependencies() 0 5 1
A addFactFinderNgClient() 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\Zed\FactFinderNg;
9
10
use Spryker\Zed\Kernel\AbstractBundleDependencyProvider;
11
use Spryker\Zed\Kernel\Container;
12
13
class FactFinderNgDependencyProvider extends AbstractBundleDependencyProvider
14
{
15
    public const CLIENT_FACT_FINDER_NG = 'CLIENT_FACT_FINDER_NG';
16
17
    /**
18
     * @param \Spryker\Zed\Kernel\Container $container
19
     *
20
     * @return \Spryker\Zed\Kernel\Container
21
     */
22
    public function provideCommunicationLayerDependencies(Container $container): Container
23
    {
24
        $container = $this->addFactFinderNgClient($container);
25
26
        return $container;
27
    }
28
29
    /**
30
     * @param \Spryker\Zed\Kernel\Container $container
31
     *
32
     * @return \Spryker\Zed\Kernel\Container
33
     */
34
    protected function addFactFinderNgClient(Container $container): Container
35
    {
36
        $container->set(static::CLIENT_FACT_FINDER_NG, function (Container $container) {
37
            return $container->getLocator()->factFinderNg()->client();
38
        });
39
40
        return $container;
41
    }
42
}
43