Passed
Push — bugfix/supesc-331-adjusted-the... ( a6d65b...656fd3 )
by Ihor
04:07
created

AkeneoPimDependencyProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provideServiceDependencies() 0 5 1
A addSession() 0 7 1
1
<?php
2
3
namespace SprykerEco\Service\AkeneoPim;
4
5
use Spryker\Service\Kernel\AbstractBundleDependencyProvider;
6
use Spryker\Service\Kernel\Container;
7
8
class AkeneoPimDependencyProvider extends AbstractBundleDependencyProvider
9
{
10
    public const CLIENT_SESSION = 'CLIENT_SESSION';
11
12
    /**
13
     * @param \Spryker\Service\Kernel\Container $container
14
     *
15
     * @return \Spryker\Service\Kernel\Container
16
     */
17
    public function provideServiceDependencies(Container $container)
18
    {
19
        $container = $this->addSession($container);
0 ignored issues
show
Bug introduced by
$container of type Spryker\Service\Kernel\Container is incompatible with the type Spryker\Zed\Kernel\Container expected by parameter $container of SprykerEco\Service\Akene...yProvider::addSession(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
        $container = $this->addSession(/** @scrutinizer ignore-type */ $container);
Loading history...
20
21
        return $container;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $container returns the type Spryker\Zed\Kernel\Container which is incompatible with the documented return type Spryker\Service\Kernel\Container.
Loading history...
22
    }
23
24
    /**
25
     * @param \Spryker\Zed\Kernel\Container $container
26
     *
27
     * @return \Spryker\Zed\Kernel\Container
28
     */
29
    protected function addSession(\Spryker\Zed\Kernel\Container $container)
30
    {
31
        $container->set(static::CLIENT_SESSION, function (Container $container) {
32
            return $container->getLocator()->session()->client();
33
        });
34
35
        return $container;
36
    }
37
}
38