DeleteIndexCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 2
crap 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