Test Failed
Push — master ( fdad3b...1a9d53 )
by Mike
07:27
created

CustomCommandFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 34
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A createCommandHydrator() 0 9 1
A createCommandFinder() 0 7 1
A getShellFacade() 0 4 1
1
<?php
2
3
4
namespace Nexus\CustomCommand;
5
6
7
use Nexus\CustomCommand\Business\Finder\CommandFinder;
8
use Nexus\CustomCommand\Business\Finder\CommandFinderInterface;
9
use Nexus\CustomCommand\Business\Hydrator\CommandHydrator;
10
use Nexus\CustomCommand\Business\Hydrator\CommandHydratorInterface;
11
use Xervice\Core\Factory\AbstractFactory;
12
13
/**
14
 * @method \Nexus\CustomCommand\CustomCommandConfig getConfig()
15
 */
16
class CustomCommandFactory extends AbstractFactory
17
{
18
    /**
19
     * @return \Nexus\CustomCommand\Business\Hydrator\CommandHydrator
20
     */
21 3
    public function createCommandHydrator(string $directory, bool $recursive) : CommandHydratorInterface
22
    {
23 3
        return new CommandHydrator(
24 3
            $this->createCommandFinder(
25 3
                $directory,
26 3
                $recursive
27
            )
28
        );
29
    }
30
31
    /**
32
     * @return \Nexus\CustomCommand\Business\Finder\CommandFinder
33
     */
34 3
    public function createCommandFinder(string $directory, bool $recursive) : CommandFinderInterface
35
    {
36 3
        return new CommandFinder(
37 3
            $directory,
38 3
            $recursive
39
        );
40
    }
41
42
    /**
43
     * @return \Nexus\Shell\ShellFacade
44
     */
45
    public function getShellFacade()
46
    {
47
        return $this->getDependency(CustomCommandDependencyProvider::SHELL_FACADE);
48
    }
49
}