fix: replace console messages with unified command.

This commit is contained in:
James Cole
2023-06-20 07:16:56 +02:00
parent f2b2c2109f
commit 42043de34f
62 changed files with 767 additions and 512 deletions

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\AccountMeta;
use Illuminate\Console\Command;
@@ -34,6 +35,8 @@ use Psr\Container\NotFoundExceptionInterface;
*/
class RenameAccountMeta extends Command
{
use ShowsFriendlyMessages;
public const CONFIG_NAME = '480_rename_account_meta';
/**
* The console command description.
@@ -59,7 +62,7 @@ class RenameAccountMeta extends Command
public function handle(): int
{
if ($this->isExecuted() && true !== $this->option('force')) {
$this->info('Correct: this command has already been executed.');
$this->friendlyInfo('This command has already been executed.');
return 0;
}
@@ -86,10 +89,10 @@ class RenameAccountMeta extends Command
$this->markAsExecuted();
if (0 === $count) {
$this->info('Correct: all account meta is OK.');
$this->friendlyPositive('All account meta is OK.');
}
if (0 !== $count) {
$this->line(sprintf('Renamed %d account meta entries (entry).', $count));
$this->friendlyInfo(sprintf('Renamed %d account meta entries (entry).', $count));
}
return 0;