Code cleanup

This commit is contained in:
James Cole
2021-03-21 09:15:40 +01:00
parent da1751940e
commit 206845575c
317 changed files with 7418 additions and 7362 deletions

View File

@@ -41,12 +41,12 @@ class PiggyBankStoreRequest extends FormRequest
public function getPiggyBankData(): array
{
return [
'name' => $this->string('name'),
'startdate' => $this->date('startdate'),
'account_id' => $this->integer('account_id'),
'targetamount' => $this->string('targetamount'),
'targetdate' => $this->date('targetdate'),
'notes' => $this->nlString('notes'),
'name' => $this->string('name'),
'startdate' => $this->date('startdate'),
'account_id' => $this->integer('account_id'),
'targetamount' => $this->string('targetamount'),
'targetdate' => $this->date('targetdate'),
'notes' => $this->nlString('notes'),
'object_group_title' => $this->string('object_group'),
];
}

View File

@@ -127,11 +127,11 @@ class RecurrenceFormRequest extends FormRequest
// replace category name with a new category:
$factory = app(CategoryFactory::class);
$factory->setUser(auth()->user());
foreach($return['transactions'] as $index => $transaction) {
$categoryName =$transaction['category_name'] ??null;
if(null !== $categoryName) {
foreach ($return['transactions'] as $index => $transaction) {
$categoryName = $transaction['category_name'] ?? null;
if (null !== $categoryName) {
$category = $factory->findOrCreate(null, $categoryName);
if(null !== $category) {
if (null !== $category) {
$return['transactions'][$index]['category_id'] = $category->id;
}
}