Completed
Push — add/changelog-tooling ( 257a85 )
by
unknown
149:15 queued 138:48
created

Application   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A doRun() 0 5 1
1
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase
2
/**
3
 * User interface for the changelogger tool.
4
 *
5
 * @package automattic/jetpack-changelogger
6
 */
7
8
namespace Automattic\Jetpack\Changelogger\Console;
9
10
use Automattic\Jetpack\Changelogger\Config;
11
use Symfony\Component\Console\Application as SymfonyApplication;
12
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
13
use Symfony\Component\Console\Input\InputInterface;
14
use Symfony\Component\Console\Output\OutputInterface;
15
16
/**
17
 * User interface for the changelogger tool.
18
 */
19
class Application extends SymfonyApplication {
20
21
	const VERSION = '1.0';
22
23
	/**
24
	 * Constructor.
25
	 */
26
	public function __construct() {
27
		parent::__construct( 'Jetpack Changelogger', self::VERSION );
28
		$this->setCommandLoader( new CommandLoader() );
29
	}
30
31
	/**
32
	 * Called when the application is run.
33
	 *
34
	 * @param InputInterface  $input InputInterface.
35
	 * @param OutputInterface $output OutputInterface.
36
	 * @return int
37
	 */
38
	public function doRun( InputInterface $input, OutputInterface $output ) {
39
		Config::setOutput( $output );
40
		$output->getFormatter()->setStyle( 'warning', new OutputFormatterStyle( 'black', 'yellow' ) );
41
		return parent::doRun( $input, $output );
42
	}
43
44
}
45