Completed
Push — add/changelog-tooling ( 7f5585...86359e )
by
unknown
58:45 queued 48:46
created

Application::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
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;
9
10
use Symfony\Component\Console\Application as SymfonyApplication;
11
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
12
use Symfony\Component\Console\Input\InputInterface;
13
use Symfony\Component\Console\Output\OutputInterface;
14
15
/**
16
 * User interface for the changelogger tool.
17
 */
18
class Application extends SymfonyApplication {
19
20
	const VERSION = '1.0';
21
22
	/**
23
	 * Constructor.
24
	 */
25
	public function __construct() {
26
		parent::__construct( 'Jetpack Changelogger', self::VERSION );
27
		$this->setCommandLoader( new CommandLoader() );
28
	}
29
30
	/**
31
	 * Called when the application is run.
32
	 *
33
	 * @param InputInterface  $input InputInterface.
34
	 * @param OutputInterface $output OutputInterface.
35
	 * @return int
36
	 */
37
	public function doRun( InputInterface $input, OutputInterface $output ) {
38
		Config::setOutput( $output );
39
		$output->getFormatter()->setStyle( 'warning', new OutputFormatterStyle( 'black', 'yellow' ) );
40
		return parent::doRun( $input, $output );
41
	}
42
43
}
44