Issues (18)

Command/MigrationsStatusCommand.php (2 issues)

1
<?php
2
3
/*
4
 * This file is part of the AntiMattr MongoDB Migrations Bundle, a library by Matthew Fitzgerald.
5
 *
6
 * (c) 2014 Matthew Fitzgerald
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace AntiMattr\Bundle\MongoDBMigrationsBundle\Command;
13
14
use AntiMattr\MongoDB\Migrations\Tools\Console\Command\StatusCommand;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Input\InputOption;
17
use Symfony\Component\Console\Output\OutputInterface;
18
19
/**
20
 * @author Matthew Fitzgerald <[email protected]>
21
 */
22
class MigrationsStatusCommand extends StatusCommand
23
{
24
    protected function configure()
25
    {
26
        parent::configure();
27
28
        $this
29
            ->setName('mongodb:migrations:status')
30
            ->addOption('dm', null, InputOption::VALUE_OPTIONAL, 'The document manager to use for this command.', 'default_document_manager')
31
        ;
32
    }
33
34
    public function execute(InputInterface $input, OutputInterface $output)
35
    {
36
        CommandHelper::setApplicationDocumentManager($this->getApplication(), $input->getOption('dm'));
0 ignored issues
show
It seems like $input->getOption('dm') can also be of type string[]; however, parameter $dmName of AntiMattr\Bundle\MongoDB...cationDocumentManager() does only seem to accept string, 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

36
        CommandHelper::setApplicationDocumentManager($this->getApplication(), /** @scrutinizer ignore-type */ $input->getOption('dm'));
Loading history...
It seems like $this->getApplication() can also be of type null; however, parameter $application of AntiMattr\Bundle\MongoDB...cationDocumentManager() does only seem to accept Symfony\Bundle\FrameworkBundle\Console\Application, 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

36
        CommandHelper::setApplicationDocumentManager(/** @scrutinizer ignore-type */ $this->getApplication(), $input->getOption('dm'));
Loading history...
37
38
        $configuration = $this->getMigrationConfiguration($input, $output);
39
        CommandHelper::configureMigrations($this->getApplication()->getKernel()->getContainer(), $configuration);
40
41
        parent::execute($input, $output);
42
    }
43
}
44