cleanup: Commands are a lot less verbal and report better on success / failue

This commit is contained in:
James Cole
2023-06-02 07:36:17 +02:00
parent 1e1497ff4e
commit dcf71c6fdf
60 changed files with 1108 additions and 1698 deletions

View File

@@ -34,18 +34,8 @@ use Illuminate\Console\Command;
*/
class FixPiggies extends Command
{
/**
* The console command description.
*
* @var string
*/
protected $description = 'Fixes common issues with piggy banks.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:fix-piggies';
protected $signature = 'firefly-iii:fix-piggies';
/**
* Execute the console command.
@@ -55,7 +45,6 @@ class FixPiggies extends Command
public function handle(): int
{
$count = 0;
$start = microtime(true);
$set = PiggyBankEvent::with(['PiggyBank', 'TransactionJournal'])->get();
/** @var PiggyBankEvent $event */
@@ -74,15 +63,12 @@ class FixPiggies extends Command
}
}
if (0 === $count) {
$this->line('All piggy bank events are correct.');
$this->info('Correct: all piggy bank events are OK.');
}
if (0 !== $count) {
$this->line(sprintf('Fixed %d piggy bank event(s).', $count));
}
$end = round(microtime(true) - $start, 2);
$this->line(sprintf('Verified the content of %d piggy bank events in %s seconds.', $set->count(), $end));
return 0;
}
}