NoteList   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 26
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
    const KEY = 'barenote:note:list';
13
14
    protected function configure()
15
    {
16
        $this
17
            ->setName(self::KEY)
18
            ->setDescription('List of your recent notes')
19
            ->setHelp('Some basic menu help');
20
    }
21
    
22
    protected function execute(InputInterface $input, OutputInterface $output)
23
    {
24
        $table = new Table($output);
25
        $table
26
            ->setHeaders(['ISBN', 'Title', 'Author'])
27
            ->setRows([
28
                ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
29
                ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'],
30
                ['960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'],
31
                ['80-902734-1-6', 'And Then There Were None', 'Agatha Christie'],
32
            ]);
33
        $table->render();
34
    }
35
}