ConsoleDependencyProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 1
f 0
dl 0
loc 26
ccs 4
cts 6
cp 0.6667
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCommandList() 0 3 1
A handleDependencies() 0 9 1
1
<?php
2
3
4
namespace Xervice\Console;
5
6
7
use Xervice\Console\Business\Model\Command\CommandCollection;
8
use Xervice\Core\Business\Model\Dependency\DependencyContainerInterface;
9
use Xervice\Core\Business\Model\Dependency\Provider\AbstractDependencyProvider;
10
11
class ConsoleDependencyProvider extends AbstractDependencyProvider
12
{
13
    public const COMMAND_COLLECTION = 'command.collection';
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
        $container[self::COMMAND_COLLECTION] = function () {
23 1
            return new CommandCollection(
24 1
                $this->getCommandList()
25
            );
26
        };
27
28 1
        return $container;
29
    }
30
31
    /**
32
     * @return array
33
     */
34
    protected function getCommandList() : array
35
    {
36
        return [];
37
    }
38
}
39