mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 12:11:19 +00:00
Use PSR-12 code style
This commit is contained in:
@@ -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();
|
||||
|
||||
|
@@ -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 */
|
||||
|
Reference in New Issue
Block a user