Skip to content

Commit

Permalink
fix BaseCommand requiring printer
Browse files Browse the repository at this point in the history
  • Loading branch information
JanTvrdik committed Jan 18, 2024
1 parent 5cfefb9 commit d35d328
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Bridges/SymfonyConsole/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Nextras\Migrations\IConfiguration;
use Nextras\Migrations\IDriver;
use Nextras\Migrations\IPrinter;
use Nextras\Migrations\Printers\Console;
use Symfony\Component\Console\Command\Command;


Expand All @@ -28,11 +29,11 @@ abstract class BaseCommand extends Command
protected $printer;


public function __construct(IDriver $driver, IConfiguration $config, IPrinter $printer)
public function __construct(IDriver $driver, IConfiguration $config, ?IPrinter $printer = null)
{
$this->driver = $driver;
$this->config = $config;
$this->printer = $printer;
$this->printer = $printer ?? new Console();
parent::__construct();
}

Expand Down

0 comments on commit d35d328

Please sign in to comment.