Issues (7)

src/Tools/Console/ConsoleRunner.php (1 issue)

Severity
1
<?php
2
3
namespace GGGGino\WarehousePath\Tools\Console;
4
5
use GGGGino\WarehousePath\Tools\Console\Command\GraphicalTestCommand;
6
use GGGGino\WarehousePath\Tools\Console\Command\MultiplePathGraphicalTestCommand;
7
use GGGGino\WarehousePath\Tools\Console\Command\PrintMatrixTestCommand;
8
use GGGGino\WarehousePath\Tools\Console\Command\ShortestPathGraphicalTestCommand;
9
use Symfony\Component\Console\Application;
10
use Symfony\Component\Console\Command\Command;
11
12
/**
13
 * Handles running the Console Tools inside Symfony Console context.
14
 */
15
class ConsoleRunner
16
{
17
    /**
18
     * Runs console with the given helperset.
19
     *
20
     * @param Command[] $commands
21
     *
22
     * @return void
23
     */
24
    public static function run($commands = [])
0 ignored issues
show
The parameter $commands is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

24
    public static function run(/** @scrutinizer ignore-unused */ $commands = [])

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        $cli = new Application('Warehouse Command Line Interface');
27
28
        $cli->setCatchExceptions(true);
29
30
        self::addCommands($cli);
31
32
        $cli->run();
33
    }
34
35
    /**
36
     * @return void
37
     */
38
    public static function addCommands(Application $cli)
39
    {
40
        $cli->addCommands([
41
            new GraphicalTestCommand(),
42
            new MultiplePathGraphicalTestCommand(),
43
            new ShortestPathGraphicalTestCommand(),
44
            new PrintMatrixTestCommand()
45
        ]);
46
    }
47
}
48