Clean up code.

This commit is contained in:
James Cole
2020-10-23 19:11:25 +02:00
parent 0845e1cb7d
commit 8dbd785ab8
57 changed files with 84 additions and 441 deletions

View File

@@ -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);
}
/**

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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));
}
/**

View File

@@ -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));
}

View File

@@ -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));
}
/**