Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

@@ -28,14 +28,11 @@ use Illuminate\Console\Command;
/**
* Class UpgradeFireflyInstructions.
*
*/
class UpgradeFireflyInstructions extends Command
{
use GeneratesInstallationId;
protected $description = 'Instructions in case of upgrade trouble.';
protected $signature = 'firefly:instructions {task}';
@@ -62,9 +59,11 @@ class UpgradeFireflyInstructions extends Command
private function updateInstructions(): void
{
$version = (string)config('firefly.version');
/** @var array $config */
$config = config('upgrade.text.upgrade');
$text = '';
/** @var string $compare */
foreach (array_keys($config) as $compare) {
// if string starts with:
@@ -97,8 +96,6 @@ class UpgradeFireflyInstructions extends Command
/**
* The logo takes up 8 lines of code. So 8 colors can be used.
*
* @return void
*/
private function showLogo(): void
{
@@ -146,27 +143,23 @@ class UpgradeFireflyInstructions extends Command
/**
* Show a nice box.
*
* @param string $text
*/
private function boxed(string $text): void
{
$parts = explode("\n", wordwrap($text));
foreach ($parts as $string) {
$this->line('| ' . sprintf('%-77s', $string) . '|');
$this->line('| '.sprintf('%-77s', $string).'|');
}
}
/**
* Show a nice info box.
*
* @param string $text
*/
private function boxedInfo(string $text): void
{
$parts = explode("\n", wordwrap($text));
foreach ($parts as $string) {
$this->info('| ' . sprintf('%-77s', $string) . '|');
$this->info('| '.sprintf('%-77s', $string).'|');
}
}
@@ -176,9 +169,11 @@ class UpgradeFireflyInstructions extends Command
private function installInstructions(): void
{
$version = (string)config('firefly.version');
/** @var array $config */
$config = config('upgrade.text.install');
$text = '';
/** @var string $compare */
foreach (array_keys($config) as $compare) {
// if string starts with: