mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
cleanup: Commands are a lot less verbal and report better on success / failue
This commit is contained in:
@@ -33,18 +33,8 @@ use Illuminate\Support\Facades\Log;
|
||||
*/
|
||||
class TransferBudgets extends Command
|
||||
{
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Removes budgets from transfers.';
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'firefly-iii:fix-transfer-budgets';
|
||||
protected $signature = 'firefly-iii:fix-transfer-budgets';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
@@ -53,7 +43,6 @@ class TransferBudgets extends Command
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
$start = microtime(true);
|
||||
$set = TransactionJournal::distinct()
|
||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->leftJoin('budget_transaction_journal', 'transaction_journals.id', '=', 'budget_transaction_journal.transaction_journal_id')
|
||||
@@ -69,8 +58,7 @@ class TransferBudgets extends Command
|
||||
$count++;
|
||||
}
|
||||
if (0 === $count) {
|
||||
$message = 'No invalid budget/journal entries.';
|
||||
Log::debug($message);
|
||||
$message = 'Correct: no invalid budget/journal entries.';
|
||||
$this->info($message);
|
||||
}
|
||||
if (0 !== $count) {
|
||||
@@ -78,9 +66,6 @@ class TransferBudgets extends Command
|
||||
Log::debug($message);
|
||||
$this->line($message);
|
||||
}
|
||||
$end = round(microtime(true) - $start, 2);
|
||||
$this->info(sprintf('Verified budget/journals in %s seconds.', $end));
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user