Completed
Push — add/changelog-tooling ( 257a85 )
by
unknown
149:15 queued 138:48
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\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