ApiDependencyProvider::handleDependencies()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
4
namespace Xervice\Api;
5
6
7
use Xervice\Core\Business\Model\Dependency\DependencyContainerInterface;
8
use Xervice\Core\Business\Model\Dependency\Provider\AbstractDependencyProvider;
9
10
class ApiDependencyProvider extends AbstractDependencyProvider
11
{
12
    public const SECURITY_FACADE = 'security.facade';
13
14
    /**
15
     * @param \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface $container
16
     *
17
     * @return \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface
18
     */
19 1
    public function handleDependencies(DependencyContainerInterface $container): DependencyContainerInterface
20
    {
21 1
        $container = $this->addSecurityFacade($container);
22
23 1
        return $container;
24
    }
25
26
    /**
27
     * @param \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface $container
28
     *
29
     * @return \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface
30
     */
31 1
    protected function addSecurityFacade(DependencyContainerInterface $container
32
    ): \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface {
33
        $container[self::SECURITY_FACADE] = function (DependencyContainerInterface $container) {
34 1
            return $container->getLocator()->security()->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

34
            return $container->getLocator()->security()->/** @scrutinizer ignore-call */ facade();
Loading history...
35
        };
36 1
        return $container;
37
}
38
}