Hello   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 11 1
A execute() 0 8 2
1
<?php
2
3
namespace Equip\Console\Command;
4
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Input\InputArgument;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class Hello extends Command
11
{
12
    protected function configure()
13
    {
14
        $this
15
            ->setName('hello')
16
            ->setDescription('Example command')
17
            ->addArgument(
18
                'name',
19
                InputArgument::OPTIONAL,
20
                'Who do you want to say hello to?'
21
            );
22
    }
23
24
    public function execute(
25
        InputInterface $input,
26
        OutputInterface $output
27
    ) {
28
        $name = $input->getArgument('name') ?: 'world';
29
30
        $output->writeln(sprintf('Hello, %s!', $name));
31
    }
32
}
33