Passed
Push — master ( dfb010...31c91b )
by Mike
03:32
created

UserDependencyProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 26
ccs 5
cts 6
cp 0.8333
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handleDependencies() 0 11 1
A getLoginPluginList() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\User;
6
7
8
9
use Xervice\Core\Business\Model\Dependency\DependencyContainerInterface;
10
use Xervice\Core\Business\Model\Dependency\Provider\AbstractDependencyProvider;
11
12
class UserDependencyProvider extends AbstractDependencyProvider
13
{
14
    public const LOGIN_PLUGINS = 'login.plugins';
15
    public const SESSION_FACADE = 'session.client';
16
17 1
    public function handleDependencies(DependencyContainerInterface $container): DependencyContainerInterface
18
    {
19
        $container[self::LOGIN_PLUGINS] = function () {
20 1
            return $this->getLoginPluginList();
21
        };
22
23
        $container[self::SESSION_FACADE] = function (DependencyContainerInterface $container) {
24
            return $container->getLocator()->session()->facade();
0 ignored issues
show
Bug introduced by
The method facade() does not exist on Xervice\Core\Business\Mo...y\LocatorProxyInterface. It seems like you code against a sub-type of said class. However, the method does not exist in Xervice\Core\Business\Mo...xy\AbstractLocatorProxy or Xervice\Core\Business\Mo...PersistenceLocatorProxy. Are you sure you never get one of those? ( Ignorable by Annotation )

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

24
            return $container->getLocator()->session()->/** @scrutinizer ignore-call */ facade();
Loading history...
25
        };
26
27 1
        return $container;
28
    }
29
30
    /**
31
     * type => {Login::class}
32
     *
33
     * @return \Xervice\User\Business\Dependency\Authenticator\Login\LoginInterface[]
34
     */
35 1
    protected function getLoginPluginList(): array
36
    {
37 1
        return [];
38
    }
39
}