Completed
Pull Request — master (#4)
by Alessandro
03:52
created

DropDatabaseCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\MongoDbBundle\Command;
6
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * Class DropDatabaseCommand.
12
 */
13
class DropDatabaseCommand extends AbstractCommand
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18 2
    protected function configure()
19
    {
20 2
        parent::configure();
21
        $this
22 2
            ->setName('mongodb:database:drop')
23 2
            ->setDescription('Drops a database');
24
        ;
25 2
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 1
    protected function execute(InputInterface $input, OutputInterface $output)
31
    {
32 1
        $this->io->writeln(sprintf('Dropping database %s', $this->connection->getDatabaseName()));
33 1
        $this->connection->drop();
34 1
        $this->io->writeln('Database dropped');
35 1
    }
36
}
37