Various code cleanup [skip ci]

This commit is contained in:
James Cole
2016-10-22 09:39:31 +02:00
parent 12a6a61100
commit 5d9b68c3e7
9 changed files with 26 additions and 83 deletions

View File

@@ -164,63 +164,4 @@ class JournalFormRequest extends Request
{
return $this->get($field) ?? '';
}
//
// /**
// * @param int $index
// * @param string $field
// *
// * @return int
// */
// private function getIntFromArray(int $index, string $field): int
// {
// $array = $this->get($field);
// if (isset($array[$index])) {
// return intval($array[$index]);
// }
//
// return 0;
// }
//
// /**
// * @param int $index
// * @param string $field
// *
// * @return string
// */
// private function getStringFromArray(int $index, string $field): string
// {
// $array = $this->get($field);
// if (isset($array[$index])) {
// return trim($array[$index]);
// }
//
// return '';
// }
//
// /**
// * @return array
// */
// private function getTransactionData(): array
// {
// $transactions = [];
// $array = $this->get('amount');
// if (is_array($array) && count($array) > 0) {
// foreach ($array as $index => $amount) {
// $transaction = [
// 'description' => $this->getStringFromArray($index, 'description'),
// 'amount' => round($amount, 2),
// 'budget_id' => $this->getIntFromArray($index, 'budget_id'),
// 'category' => $this->getStringFromArray($index, 'category'),
// 'source_account_id' => $this->getIntFromArray($index, 'source_account_id'),
// 'source_account_name' => $this->getStringFromArray($index, 'source_account_name'),
// 'destination_account_id' => $this->getIntFromArray($index, 'destination_account_id'),
// 'destination_account_name' => $this->getStringFromArray($index, 'destination_account_name'),
// 'piggy_bank_id' => $this->getIntFromArray($index, 'piggy_bank_id'),
// ];
// $transactions[] = $transaction;
// }
// }
//
// return $transactions;
// }
}