mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 11:48:05 +00:00
Clean up code.
This commit is contained in:
@@ -60,8 +60,10 @@ abstract class Controller extends BaseController
|
||||
$language = app('steam')->getLanguage();
|
||||
app()->setLocale($language);
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -73,7 +75,7 @@ abstract class Controller extends BaseController
|
||||
private function getParameters(): ParameterBag
|
||||
{
|
||||
$bag = new ParameterBag;
|
||||
$page = (int) request()->get('page');
|
||||
$page = (int)request()->get('page');
|
||||
if (0 === $page) {
|
||||
$page = 1;
|
||||
}
|
||||
@@ -100,7 +102,7 @@ abstract class Controller extends BaseController
|
||||
foreach ($integers as $integer) {
|
||||
$value = request()->query->get($integer);
|
||||
if (null !== $value) {
|
||||
$bag->set($integer, (int) $value);
|
||||
$bag->set($integer, (int)$value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,9 +129,8 @@ abstract class Controller extends BaseController
|
||||
}
|
||||
$params[$key] = $value;
|
||||
}
|
||||
$return .= http_build_query($params);
|
||||
|
||||
return $return;
|
||||
return $return . http_build_query($params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -132,8 +132,6 @@ class AccountStoreRequest extends FormRequest
|
||||
'interest_period' => 'required_if:type,liability|in:daily,monthly,yearly',
|
||||
'notes' => 'min:0|max:65536',
|
||||
];
|
||||
$rules = Location::requestRules($rules);
|
||||
|
||||
return $rules;
|
||||
return Location::requestRules($rules);
|
||||
}
|
||||
}
|
||||
|
@@ -134,8 +134,6 @@ class AccountUpdateRequest extends FormRequest
|
||||
'interest_period' => 'required_if:type,liability|in:daily,monthly,yearly',
|
||||
'notes' => 'min:0|max:65536',
|
||||
];
|
||||
$rules = Location::requestRules($rules);
|
||||
|
||||
return $rules;
|
||||
return Location::requestRules($rules);
|
||||
}
|
||||
}
|
||||
|
@@ -67,10 +67,7 @@ class RuleGroupTestRequest extends FormRequest
|
||||
*/
|
||||
private function getDate(string $field): ?Carbon
|
||||
{
|
||||
/** @var Carbon $result */
|
||||
$result = null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', $this->query($field));
|
||||
|
||||
return $result;
|
||||
return null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', $this->query($field));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -66,7 +66,6 @@ class RuleGroupTriggerRequest extends FormRequest
|
||||
*/
|
||||
private function getDate(string $field): ?Carbon
|
||||
{
|
||||
/** @var Carbon $result */
|
||||
return null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', $this->query($field));
|
||||
}
|
||||
|
||||
|
@@ -77,10 +77,7 @@ class RuleTestRequest extends FormRequest
|
||||
*/
|
||||
private function getDate(string $field): ?Carbon
|
||||
{
|
||||
/** @var Carbon $result */
|
||||
$result = null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', $this->query($field));
|
||||
|
||||
return $result;
|
||||
return null === $this->query($field) ? null : Carbon::createFromFormat('Y-m-d', $this->query($field));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user