Issues (590)

src/Migration/Console/AbstractCommand.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Bdf\Prime\Migration\Console;
4
5
use Bdf\Prime\Migration\MigrationManager;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * AbstractCommand
12
 */
13
abstract class AbstractCommand extends Command
14
{
15
    /**
16
     * @var MigrationManager
17
     */
18
    private $manager;
19
20
    /**
21
     * Migration command constructor.
22
     *
23
     * @param MigrationManager $manager
24
     */
25 32
    public function __construct(MigrationManager $manager)
26
    {
27 32
        $this->manager = $manager;
28
29 32
        parent::__construct(static::$defaultName);
30
    }
31
32
    /**
33
     * Add console context on manager
34
     *
35
     * @param InputInterface $input
36
     * @param OutputInterface $output
37
     *
38
     * @return MigrationManager
39
     */
40 32
    public function manager(InputInterface $input, OutputInterface $output): MigrationManager
41
    {
42 32
        $this->manager->setOutput($output);
43 32
        $this->manager->setInput($input);
44 32
        $this->manager->setHelper($this->getHelperSet());
0 ignored issues
show
It seems like $this->getHelperSet() can also be of type null; however, parameter $helper of Bdf\Prime\Migration\MigrationManager::setHelper() does only seem to accept Symfony\Component\Console\Helper\HelperSet, 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

44
        $this->manager->setHelper(/** @scrutinizer ignore-type */ $this->getHelperSet());
Loading history...
45
46 32
        return $this->manager;
47
    }
48
}
49