mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	Various code cleanup.
This commit is contained in:
		| @@ -52,7 +52,7 @@ class FixFrontpageAccounts extends Command | ||||
|         $users = User::get(); | ||||
|         /** @var User $user */ | ||||
|         foreach ($users as $user) { | ||||
|             $preference = Preferences::getForUser($user, 'frontPageAccounts'); | ||||
|             $preference = app('preferences')->getForUser($user, 'frontPageAccounts'); | ||||
|             if (null !== $preference) { | ||||
|                 $this->fixPreference($preference); | ||||
|             } | ||||
|   | ||||
| @@ -60,7 +60,7 @@ class FixTransactionTypes extends Command | ||||
|             } | ||||
|         } | ||||
|         if ($count > 0) { | ||||
|             $this->friendlyInfo('Corrected transaction type of %d transaction journals.', $count); | ||||
|             $this->friendlyInfo(sprintf('Corrected transaction type of %d transaction journals.', $count)); | ||||
| 
 | ||||
|             return 0; | ||||
|         } | ||||
|   | ||||
| @@ -26,8 +26,6 @@ namespace FireflyIII\Console\Commands\System; | ||||
| use FireflyIII\Support\System\GeneratesInstallationId; | ||||
| use Illuminate\Console\Command; | ||||
| 
 | ||||
| use function FireflyIII\Console\Commands\str_starts_with; | ||||
| 
 | ||||
| /** | ||||
|  * Class UpgradeFireflyInstructions. | ||||
|  * | ||||
| @@ -77,7 +75,7 @@ class UpgradeFireflyInstructions extends Command | ||||
|         $text    = ''; | ||||
|         foreach (array_keys($config) as $compare) { | ||||
|             // if string starts with:
 | ||||
|             if (\str_starts_with($version, $compare)) { | ||||
|             if (str_starts_with($version, $compare)) { | ||||
|                 $text = $config[$compare]; | ||||
|             } | ||||
|         } | ||||
| @@ -190,7 +188,7 @@ class UpgradeFireflyInstructions extends Command | ||||
|         $text    = ''; | ||||
|         foreach (array_keys($config) as $compare) { | ||||
|             // if string starts with:
 | ||||
|             if (\str_starts_with($version, $compare)) { | ||||
|             if (str_starts_with($version, $compare)) { | ||||
|                 $text = $config[$compare]; | ||||
|             } | ||||
|         } | ||||
|   | ||||
| @@ -65,7 +65,7 @@ class VerifySecurityAlerts extends Command | ||||
|         $version = config('firefly.version'); | ||||
|         $disk    = Storage::disk('resources'); | ||||
|         // Next line is ignored because it's a Laravel Facade.
 | ||||
|         if (!$disk->has('alerts.json')) { // @phpstan-ignore-line
 | ||||
|         if (!$disk->has('alerts.json')) { | ||||
|             Log::debug('No alerts.json file present.'); | ||||
| 
 | ||||
|             return 0; | ||||
|   | ||||
| @@ -142,7 +142,7 @@ class UpgradeCurrencyPreferences extends Command | ||||
|         // set the default currency for the user and for the group:
 | ||||
|         $preference      = $this->getPreference($user); | ||||
|         $defaultCurrency = TransactionCurrency::where('code', $preference)->first(); | ||||
|         if (null === $currency) { | ||||
|         if (null === $defaultCurrency) { | ||||
|             // get EUR
 | ||||
|             $defaultCurrency = TransactionCurrency::where('code', 'EUR')->first(); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user