Command   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 2
b 0
f 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 4 1
A execute() 0 8 1
1
<?php
2
3
namespace AppBundle\ShowUnusedMySQLTables;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use Symfony\Component\Console\Style\SymfonyStyle;
9
10
/**
11
 * Symfony-Console-Command wrapper for the ShowUnusedMySQLTables task.
12
 */
13
final class Command extends ContainerAwareCommand
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    protected function configure()
19
    {
20
        $this->setName('show-unused-mysql-tables')
21
             ->setDescription('Show a list of potentially unused MySQL tables.');
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function execute(InputInterface $input, OutputInterface $output)
28
    {
29
        $container = $this->getContainer();
30
        $task = new Task(
31
            $container->get('doctrine.dbal.default_connection'),
0 ignored issues
show
Bug introduced by
It seems like $container->get('doctrin...al.default_connection') can also be of type null; however, parameter $connection of AppBundle\ShowUnusedMySQ...les\Task::__construct() does only seem to accept Doctrine\DBAL\Connection, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

31
            /** @scrutinizer ignore-type */ $container->get('doctrine.dbal.default_connection'),
Loading history...
32
            $container->getParameter('db_system_catalog_prefix')
33
        );
34
        $task->getUnusedTableNames(new SymfonyStyle($input, $output));
35
    }
36
}
37