CommandFactory::tester()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 3
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