DeleteIndexCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 4
dl 0
loc 17
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
A execute() 0 7 1
1
<?php
2
3
namespace Zenstruck\ElasticaBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use Zenstruck\ElasticaBundle\Elastica\IndexManager;
9
10
/**
11
 * @author Kevin Bond <[email protected]>
12
 */
13
class DeleteIndexCommand extends ContainerAwareCommand
14
{
15 1
    protected function configure()
16
    {
17 1
        $this
18 1
            ->setName('zenstruck:elastica:delete')
19 1
            ->setDescription('Delete the elasticsearch index.');
20 1
    }
21
22 1
    protected function execute(InputInterface $input, OutputInterface $output)
23
    {
24
        /** @var IndexManager $indexManager */
25 1
        $indexManager = $this->getContainer()->get('zenstruck_elastica.index_manager');
26
27 1
        $indexManager->delete();
28 1
    }
29
}
30