Use PSR-12 code style

This commit is contained in:
James Cole
2022-10-30 14:24:28 +01:00
parent 2eebcb21f1
commit f53923f16c
187 changed files with 429 additions and 482 deletions

View File

@@ -189,7 +189,7 @@ trait ModifiesPiggyBanks
public function createEvent(PiggyBank $piggyBank, string $amount): PiggyBankEvent
{
if (0 === bccomp('0', $amount)) {
return new PiggyBankEvent;
return new PiggyBankEvent();
}
return PiggyBankEvent::create(['date' => Carbon::now(), 'amount' => $amount, 'piggy_bank_id' => $piggyBank->id]);
@@ -242,7 +242,6 @@ trait ModifiesPiggyBanks
}
return $piggyBank;
}
/**
@@ -295,7 +294,6 @@ trait ModifiesPiggyBanks
$piggyBank->objectGroups()->sync([$objectGroup->id]);
$piggyBank->save();
}
}
// try also with ID
$objectGroupId = (int) ($data['object_group_id'] ?? 0);
@@ -377,7 +375,7 @@ trait ModifiesPiggyBanks
}
$dbNote = $piggyBank->notes()->first();
if (null === $dbNote) {
$dbNote = new Note;
$dbNote = new Note();
$dbNote->noteable()->associate($piggyBank);
}
$dbNote->text = trim($note);
@@ -475,7 +473,6 @@ trait ModifiesPiggyBanks
}
if (array_key_exists('startdate', $data)) {
$piggyBank->startdate = $data['startdate'];
}
$piggyBank->save();

View File

@@ -239,7 +239,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
$room = bcsub((string) $piggyBank->targetamount, (string) $repetition->currentamount);
$compare = bcmul($repetition->currentamount, '-1');
if(bccomp((string) $piggyBank->targetamount,'0') === 0) {
if (bccomp((string) $piggyBank->targetamount, '0') === 0) {
// amount is zero? then the "room" is positive amount of we wish to add or remove.
$room = app('steam')->positive($amount);
Log::debug(sprintf('Room is now %s', $room));
@@ -302,7 +302,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
*/
public function getPiggyBanksWithAmount(): Collection
{
$currency = app('amount')->getDefaultCurrency();
$set = $this->getPiggyBanks();
@@ -370,7 +369,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
*/
public function leftOnAccount(PiggyBank $piggyBank, Carbon $date): string
{
$balance = app('steam')->balanceIgnoreVirtual($piggyBank->account, $date);
/** @var Collection $piggies */