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

UserDependencyProvider::handleDependencies()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1.0156

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 11
ccs 3
cts 4
cp 0.75
crap 1.0156
rs 10
c 0
b 0
f 0
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
}