diff --git a/src/DatabaseDumpCommand.php b/src/DatabaseDumpCommand.php index 1bd8a35..c3037a7 100644 --- a/src/DatabaseDumpCommand.php +++ b/src/DatabaseDumpCommand.php @@ -6,6 +6,8 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; +use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\StreamOutput; use Worksome\Foggy\DumpProcess; @@ -29,7 +31,11 @@ public function handle(): void ? new StreamOutput(fopen($this->option('output'), 'w')) : $this->getOutput()->getOutput(); - $consoleOutput = $this->option('output') ? $this->getOutput()->getOutput() : null; + $consoleOutput = match (true) { + $this->option('output') && ! $this->option('quiet') => new ConsoleOutput(OutputInterface::VERBOSITY_QUIET), + $this->option('output') => $this->getOutput()->getOutput(), + default => null, + }; $process = new DumpProcess( DB::connection($this->option('connection'))->getDoctrineConnection(),