mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various code cleanup.
This commit is contained in:
@@ -45,7 +45,7 @@ class ReconciliationStoreRequest extends FormRequest
|
||||
{
|
||||
$transactions = $this->get('journals');
|
||||
if (!is_array($transactions)) {
|
||||
$transactions = []; // @codeCoverageIgnore
|
||||
$transactions = [];
|
||||
}
|
||||
$data = [
|
||||
'start' => $this->date('start'),
|
||||
|
@@ -109,7 +109,7 @@ class RecurrenceFormRequest extends FormRequest
|
||||
// fill in source and destination account data
|
||||
switch ($this->string('transaction_type')) {
|
||||
default:
|
||||
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->string('transaction_type'))); // @codeCoverageIgnore
|
||||
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->string('transaction_type')));
|
||||
case 'withdrawal':
|
||||
$return['transactions'][0]['source_id'] = $this->integer('source_id');
|
||||
$return['transactions'][0]['destination_id'] = $this->integer('withdrawal_destination_id');
|
||||
@@ -251,7 +251,7 @@ class RecurrenceFormRequest extends FormRequest
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new FireflyException(sprintf('Cannot handle transaction type of type "%s"', $this->string('transaction_type'))); // @codeCoverageIgnore
|
||||
throw new FireflyException(sprintf('Cannot handle transaction type of type "%s"', $this->string('transaction_type')));
|
||||
}
|
||||
|
||||
// update some rules in case the user is editing a post:
|
||||
@@ -308,7 +308,7 @@ class RecurrenceFormRequest extends FormRequest
|
||||
|
||||
switch ($this->string('transaction_type')) {
|
||||
default:
|
||||
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->string('transaction_type'))); // @codeCoverageIgnore
|
||||
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->string('transaction_type')));
|
||||
case 'withdrawal':
|
||||
$sourceId = (int)$data['source_id'];
|
||||
$destinationId = (int)$data['withdrawal_destination_id'];
|
||||
|
@@ -149,12 +149,12 @@ class ReportFormRequest extends FormRequest
|
||||
if (2 === count($parts)) {
|
||||
try {
|
||||
$date = new Carbon($parts[1]);
|
||||
// @codeCoverageIgnoreStart
|
||||
|
||||
} catch (Exception $e) {
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage());
|
||||
Log::error($error);
|
||||
throw new FireflyException($error);
|
||||
// @codeCoverageIgnoreEnd
|
||||
throw new FireflyException($error, 0, $e);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -177,12 +177,12 @@ class ReportFormRequest extends FormRequest
|
||||
if (2 === count($parts)) {
|
||||
try {
|
||||
$date = new Carbon($parts[0]);
|
||||
// @codeCoverageIgnoreStart
|
||||
|
||||
} catch (Exception $e) {
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage());
|
||||
Log::error($error);
|
||||
throw new FireflyException($error);
|
||||
// @codeCoverageIgnoreEnd
|
||||
throw new FireflyException($error, 0, $e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user