UpdateCommand::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 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