Total Complexity | 3 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class Application extends \Symfony\Component\Console\Application |
||
13 | { |
||
14 | /** |
||
15 | * Gets the name of the command based on input. |
||
16 | * |
||
17 | * @param InputInterface $input The input interface |
||
18 | * |
||
19 | * @return string The command name |
||
20 | */ |
||
21 | protected function getCommandName(InputInterface $input) |
||
22 | { |
||
23 | // This should return the name of your command. |
||
24 | return 'test'; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Gets the default commands that should always be available. |
||
29 | * |
||
30 | * @return array An array of default Command instances |
||
31 | */ |
||
32 | protected function getDefaultCommands() |
||
33 | { |
||
34 | // Keep the core default commands to have the HelpCommand |
||
35 | // which is used when using the --help option |
||
36 | $defaultCommands = parent::getDefaultCommands(); |
||
37 | |||
38 | $defaultCommands[] = new TestCommand(); |
||
39 | |||
40 | return $defaultCommands; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Overridden so that the application doesn't expect the command |
||
45 | * name to be the first argument. |
||
46 | */ |
||
47 | public function getDefinition() |
||
54 | } |
||
55 | } |
||
56 |