UpdateSchemaDoctrineCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A execute() 0 6 1
1
<?php
2
3
namespace Doctrine\Bundle\DoctrineBundle\Command\Proxy;
4
5
use Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Input\InputOption;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * Command to generate the SQL needed to update the database schema to match
12
 * the current mapping information.
13
 */
14
class UpdateSchemaDoctrineCommand extends UpdateCommand
15
{
16
    /**
17
     * {@inheritDoc}
18
     */
19
    protected function configure()
20
    {
21
        parent::configure();
22
23
        $this
24
            ->setName('doctrine:schema:update')
25
            ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command');
26
    }
27
28
    /**
29
     * {@inheritDoc}
30
     */
31
    protected function execute(InputInterface $input, OutputInterface $output)
32
    {
33
        DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
0 ignored issues
show
Documentation introduced by
$this->getApplication() is of type null|object<Symfony\Comp...nt\Console\Application>, but the function expects a object<Symfony\Bundle\Fr...le\Console\Application>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
34
35
        return parent::execute($input, $output);
36
    }
37
}
38