Skip to content

Commit b9b47c7

Browse files
committed
Fix PHPStan issue: Parameter #1 $kernel of class Symfony\Bundle\FrameworkBundle\Console\Application constructor expects Symfony\Component\HttpKernel\KernelInterface, Symfony\Component\HttpKernel\KernelInterface|null given
1 parent dbe002c commit b9b47c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/Command/AbstractCommandTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1616
use Symfony\Component\Console\Command\Command;
1717
use Symfony\Component\Console\Tester\CommandTester;
18+
use Symfony\Component\HttpKernel\KernelInterface;
1819

1920
abstract class AbstractCommandTest extends KernelTestCase
2021
{
@@ -33,7 +34,9 @@ protected function executeCommand(array $arguments, array $inputs = []): Command
3334
// this uses a special testing container that allows you to fetch private services
3435
/** @var Command $command */
3536
$command = static::getContainer()->get($this->getCommandFqcn());
36-
$command->setApplication(new Application(self::$kernel));
37+
/** @var KernelInterface $kernel */
38+
$kernel = self::$kernel;
39+
$command->setApplication(new Application($kernel));
3740

3841
$commandTester = new CommandTester($command);
3942
$commandTester->setInputs($inputs);

0 commit comments

Comments
 (0)