ConsoleDependencyProvider::handleDependencies()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 4
c 1
b 1
f 0
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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