Completed
Pull Request — master (#1036)
by
unknown
01:56
created

PingDoctrineCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A execute() 0 6 1
1
<?php
2
3
namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy;
4
5
use Doctrine\DBAL\Tools\Console\Command\PingCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Input\InputOption;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * Ping the database to check its accessible.
12
 */
13
class PingDoctrineCommand extends PingCommand
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    protected static $defaultName = 'doctrine:ping';
19
20
    /**
21
     * {@inheritDoc}
22
     */
23
    protected function configure()
24
    {
25
        parent::configure();
26
27
        $this
28
            ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command');
29
    }
30
31
    /**
32
     * {@inheritDoc}
33
     */
34
    protected function execute(InputInterface $input, OutputInterface $output)
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
35
    {
36
        DoctrineCommandHelper::setApplicationConnection($this->getApplication(), $input->getOption('connection'));
37
38
        return parent::execute($input, $output);
39
    }
40
}
41