HiCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 9
cts 9
cp 1
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
crap 1
1
<?php
2
namespace Tivnet\WPDB\Command;
3
4
use Symfony\Component\Console\Command\Command;
5
use Symfony\Component\Console\Input\InputInterface;
6
use Symfony\Component\Console\Output\OutputInterface;
7
use Symfony\Component\Console\Input\InputArgument;
8
use Symfony\Component\Console\Input\InputOption;
9
10
/**
11
 * Class HiCommand
12
 * @package Tivnet\WPDB\Command
13
 */
14
class HiCommand extends Command {
15
16
	/**
17
	 * Configuration
18
	 *
19
	 * @return void
20
	 */
21 1
	protected function configure() {
22 1
		$this->setName( 'hi' )
23 1
		     ->setDescription( "This command prints 'Hi World!'" )
24 1
		     ->setDefinition( array(
25 1
			     new InputOption( 'flag', 'f', InputOption::VALUE_NONE, 'Raise a flag' ),
26 1
			     new InputArgument( 'activities', InputArgument::IS_ARRAY, 'Space-separated activities to perform', null ),
27
		     ) )
28 1
		     ->setHelp( /** @lang text */
29 1
			     "The <info>hi</info> command just prints 'Hi World!'" );
30 1
	}
31
32
	/**
33
	 * Executes the command
34
	 *
35
	 * @param InputInterface  $input
36
	 * @param OutputInterface $output
37
	 *
38
	 * @return null|int
39
	 */
40 1
	protected function execute( InputInterface $input, OutputInterface $output ) {
41 1
		$output->writeln( 'Hi World!' );
42
43 1
		return null;
44
	}
45
}
46