CommandFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
cbo 3
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A tester() 0 10 1
1
<?php
2
3
namespace Bowerphp\Factory;
4
5
use Bowerphp\Console\Application;
6
use Symfony\Component\Console\Tester\CommandTester;
7
8
class CommandFactory
9
{
10
    public static function tester($command, array $parameters = [], array $options = ['decorated' => false])
11
    {
12
        $application = new Application();
13
        $command = $application->get($command);
14
        $commandTester = new CommandTester($command);
15
        $input = array_merge($parameters, ['command' => $command->getName()]);
16
        $commandTester->execute($input, $options);
17
18
        return $commandTester;
19
    }
20
}
21