Skip to content

Commit

Permalink
Fix PHPStan issue: Parameter #1 $kernel of class Symfony\Bundle\Frame…
Browse files Browse the repository at this point in the history
…workBundle\Console\Application constructor expects Symfony\Component\HttpKernel\KernelInterface, Symfony\Component\HttpKernel\KernelInterface|null given
  • Loading branch information
javiereguiluz committed Nov 24, 2023
1 parent 0e0d8ae commit f3b8cd0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/Command/AbstractCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\HttpKernel\KernelInterface;

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

$commandTester = new CommandTester($command);
$commandTester->setInputs($inputs);
Expand Down

0 comments on commit f3b8cd0

Please sign in to comment.