Use PSR-12 code style

This commit is contained in:
James Cole
2022-10-30 12:24:51 +01:00
parent bdcd9825ec
commit b27fe59ab4
44 changed files with 414 additions and 332 deletions

View File

@@ -68,7 +68,7 @@ class ReportSum extends Command
/** @var User $user */
foreach ($userRepository->all() as $user) {
$sum = (string) $user->transactions()->sum('amount');
$sum = (string)$user->transactions()->sum('amount');
if (0 !== bccomp($sum, '0')) {
$message = sprintf('Error: Transactions for user #%d (%s) are off by %s!', $user->id, $user->email, $sum);
$this->error($message);

View File

@@ -47,19 +47,18 @@ use Illuminate\Console\Command;
*/
class UpdateGroupInformation extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:upgrade-group-information';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Makes sure that every object is linked to a group';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:upgrade-group-information';
/**
* Execute the console command.
@@ -87,19 +86,31 @@ class UpdateGroupInformation extends Command
$this->warn(sprintf('User "%s" has no group.', $user->email));
return;
}
$set = [Account::class, Attachment::class, AvailableBudget::class,
Bill::class, Budget::class, Category::class, CurrencyExchangeRate::class,
Recurrence::class, RuleGroup::class, Rule::class, Tag::class, TransactionGroup::class,
TransactionJournal::class, Webhook::class];
$set = [
Account::class,
Attachment::class,
AvailableBudget::class,
Bill::class,
Budget::class,
Category::class,
CurrencyExchangeRate::class,
Recurrence::class,
RuleGroup::class,
Rule::class,
Tag::class,
TransactionGroup::class,
TransactionJournal::class,
Webhook::class,
];
foreach ($set as $className) {
$this->updateGroupInfoForObject($user, $group, $className);
}
}
/**
* @param User $user
* @param UserGroup $group
* @param string $className
* @param User $user
* @param UserGroup $group
* @param string $className
* @return void
*/
private function updateGroupInfoForObject(User $user, UserGroup $group, string $className): void