Failed Conditions
Push — master ( 6fca32...0b1cfb )
by Michał
02:10
created

NoteList   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A execute() 0 13 1
1
<?php
2
namespace BarenoteCli\Command\Note;
3
4
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Helper\Table;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class NoteList extends Command
11
{
12
    protected function configure()
13
    {
14
        $this
15
            ->setName('barenote:note:list')
16
            ->setDescription('List of your recent notes')
17
            ->setHelp('Some basic menu help');
18
    }
19
    
20
    protected function execute(InputInterface $input, OutputInterface $output)
21
    {
22
        $table = new Table($output);
23
        $table
24
            ->setHeaders(['ISBN', 'Title', 'Author'])
25
            ->setRows([
26
                ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
27
                ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'],
28
                ['960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'],
29
                ['80-902734-1-6', 'And Then There Were None', 'Agatha Christie'],
30
            ]);
31
        $table->render();
32
    }
33
}