UpdateCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 27
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
A execute() 0 11 1
1
<?php
2
3
namespace EmanueleMinotto\DomainParserBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
/**
10
 * Updates domains list.
11
 *
12
 * @author Emanuele Minotto <[email protected]>
13
 */
14
class UpdateCommand extends ContainerAwareCommand
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19 3
    protected function configure()
20
    {
21 3
        $this
22 3
            ->setName('domain-parser:update')
23 3
            ->setDescription('Updates domains list');
24 3
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 3
    protected function execute(InputInterface $input, OutputInterface $output)
30
    {
31 3
        $container = $this->getContainer();
32 3
        $manager = $container->get('pdp.public_suffix_list_manager');
33
34 3
        $output->write('Updating public suffix list... ');
35
36 3
        $manager->refreshPublicSuffixList();
37
38 3
        $output->writeln('<info>done</info>');
39 3
    }
40
}
41