mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-01 02:21:45 +00:00
Various PSR12 code cleanup
This commit is contained in:
@@ -172,6 +172,23 @@ class EventServiceProvider extends ServiceProvider
|
||||
$this->registerBudgetEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO needs a dedicated (static) method.
|
||||
*/
|
||||
protected function registerCreateEvents(): void
|
||||
{
|
||||
PiggyBank::created(
|
||||
static function (PiggyBank $piggyBank) {
|
||||
$repetition = new PiggyBankRepetition();
|
||||
$repetition->piggyBank()->associate($piggyBank);
|
||||
$repetition->startdate = $piggyBank->startdate;
|
||||
$repetition->targetdate = $piggyBank->targetdate;
|
||||
$repetition->currentamount = 0;
|
||||
$repetition->save();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO needs a dedicated method.
|
||||
*/
|
||||
@@ -224,21 +241,4 @@ class EventServiceProvider extends ServiceProvider
|
||||
BudgetLimit::created($func);
|
||||
BudgetLimit::updated($func);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO needs a dedicated (static) method.
|
||||
*/
|
||||
protected function registerCreateEvents(): void
|
||||
{
|
||||
PiggyBank::created(
|
||||
static function (PiggyBank $piggyBank) {
|
||||
$repetition = new PiggyBankRepetition();
|
||||
$repetition->piggyBank()->associate($piggyBank);
|
||||
$repetition->startdate = $piggyBank->startdate;
|
||||
$repetition->targetdate = $piggyBank->targetdate;
|
||||
$repetition->currentamount = 0;
|
||||
$repetition->save();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user