mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 15:18:05 +00:00
Code cleanup.
This commit is contained in:
@@ -43,8 +43,6 @@ class ReportFormRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Validate list of accounts.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAccountList(): Collection
|
||||
{
|
||||
@@ -67,8 +65,6 @@ class ReportFormRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Validate list of budgets.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getBudgetList(): Collection
|
||||
{
|
||||
@@ -90,8 +86,6 @@ class ReportFormRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Validate list of categories.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getCategoryList(): Collection
|
||||
{
|
||||
@@ -113,8 +107,6 @@ class ReportFormRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Validate list of accounts which exist twice in system.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getDoubleList(): Collection
|
||||
{
|
||||
@@ -137,8 +129,6 @@ class ReportFormRequest extends FormRequest
|
||||
/**
|
||||
* Validate end date.
|
||||
*
|
||||
* @return Carbon
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getEndDate(): Carbon
|
||||
@@ -154,26 +144,28 @@ class ReportFormRequest extends FormRequest
|
||||
if (false !== preg_match($pattern, $string)) {
|
||||
try {
|
||||
$date = new Carbon($parts[1]);
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
} catch (\Exception $e) { // intentional generic exception
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage());
|
||||
app('log')->error($error);
|
||||
app('log')->error($e->getTraceAsString());
|
||||
|
||||
throw new FireflyException($error, 0, $e);
|
||||
}
|
||||
|
||||
return $date;
|
||||
}
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, 'invalid format :(');
|
||||
app('log')->error($error);
|
||||
|
||||
throw new FireflyException($error, 0);
|
||||
}
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate start date.
|
||||
*
|
||||
* @return Carbon
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getStartDate(): Carbon
|
||||
@@ -189,16 +181,19 @@ class ReportFormRequest extends FormRequest
|
||||
if (false !== preg_match($pattern, $string)) {
|
||||
try {
|
||||
$date = new Carbon($parts[0]);
|
||||
} catch (Exception $e) { // intentional generic exception
|
||||
} catch (\Exception $e) { // intentional generic exception
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, $e->getMessage());
|
||||
app('log')->error($error);
|
||||
app('log')->error($e->getTraceAsString());
|
||||
|
||||
throw new FireflyException($error, 0, $e);
|
||||
}
|
||||
|
||||
return $date;
|
||||
}
|
||||
$error = sprintf('"%s" is not a valid date range: %s', $range, 'invalid format :(');
|
||||
app('log')->error($error);
|
||||
|
||||
throw new FireflyException($error, 0);
|
||||
}
|
||||
|
||||
@@ -207,8 +202,6 @@ class ReportFormRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Validate list of tags.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getTagList(): Collection
|
||||
{
|
||||
@@ -221,6 +214,7 @@ class ReportFormRequest extends FormRequest
|
||||
}
|
||||
if (!is_array($set)) {
|
||||
app('log')->error(sprintf('Set is not an array! "%s"', $set));
|
||||
|
||||
return $collection;
|
||||
}
|
||||
foreach ($set as $tagTag) {
|
||||
@@ -228,6 +222,7 @@ class ReportFormRequest extends FormRequest
|
||||
$tag = $repository->findByTag($tagTag);
|
||||
if (null !== $tag) {
|
||||
$collection->push($tag);
|
||||
|
||||
continue;
|
||||
}
|
||||
$tag = $repository->find((int)$tagTag);
|
||||
@@ -241,8 +236,6 @@ class ReportFormRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* Rules for this request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user