-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathApplication.php
50 lines (41 loc) · 1.23 KB
/
Application.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
namespace CodeClimate\PhpTestReporter;
use CodeClimate\PhpTestReporter\ConsoleCommands\UploadCommand;
use Symfony\Component\Console\Application as BaseApplication;
use Symfony\Component\Console\Input\InputInterface;
/**
* Coveralls API application.
* @author Kitamura Satoshi <with.no.parachute@gmail.com>
*/
class Application extends BaseApplication
{
// internal method
protected function getCommandName(InputInterface $input)
{
return 'upload';
}
protected function getDefaultCommands()
{
// Keep the core default commands to have the HelpCommand
// which is used when using the --help option
$defaultCommands = parent::getDefaultCommands();
$defaultCommands[] = $this->createUploadCommand();
return $defaultCommands;
}
/**
* Create UploadCommand.
* @return UploadCommand
*/
protected function createUploadCommand()
{
return new UploadCommand('upload');
}
// accessor
public function getDefinition()
{
$inputDefinition = parent::getDefinition();
// clear out the normal first argument, which is the command name
$inputDefinition->setArguments();
return $inputDefinition;
}
}