CustomCommandDependencyProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handleDependencies() 0 5 1
A addShellFacade() 0 7 1
1
<?php
2
3
4
namespace Nexus\CustomCommand;
5
6
7
use Xervice\Core\Business\Model\Dependency\DependencyContainerInterface;
8
use Xervice\Core\Business\Model\Dependency\Provider\AbstractDependencyProvider;
9
use Xervice\Core\Business\Model\Dependency\Provider\DependencyProviderInterface;
10
11
class CustomCommandDependencyProvider extends AbstractDependencyProvider
12
{
13
    public const SHELL_FACADE = 'shell.facade';
14
15
    /**
16
     * @param \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface $container
17
     *
18
     * @return \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface
19
     */
20 1
    public function handleDependencies(DependencyContainerInterface $container): DependencyContainerInterface
21
    {
22 1
        $container = $this->addShellFacade($container);
23
24 1
        return $container;
25
    }
26
27
    /**
28
     * @param \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface $container
29
     *
30
     * @return \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface
31
     */
32 1
    protected function addShellFacade(DependencyContainerInterface $container): DependencyContainerInterface
33
    {
34
        $container[self::SHELL_FACADE] = function(DependencyContainerInterface $container) {
35
            return $container->getLocator()->shell()->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

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