Code cleanup

This commit is contained in:
James Cole
2018-04-28 06:23:13 +02:00
parent 6f0e1c79ac
commit 13b78bdc20
218 changed files with 621 additions and 681 deletions

View File

@@ -158,7 +158,7 @@ class BoxController extends Controller
'incomes' => $incomes,
'expenses' => $expenses,
'sums' => $sums,
'size' => count($sums),
'size' => \count($sums),
];
$cache->store($response);

View File

@@ -35,8 +35,7 @@ class FrontpageController extends Controller
* @param PiggyBankRepositoryInterface $repository
*
* @return \Illuminate\Http\JsonResponse
*
* @throws \Throwable
*/
public function piggyBanks(PiggyBankRepositoryInterface $repository)
{
@@ -61,7 +60,7 @@ class FrontpageController extends Controller
}
}
$html = '';
if (count($info) > 0) {
if (\count($info) > 0) {
$html = view('json.piggy-banks', compact('info'))->render();
}

View File

@@ -43,7 +43,7 @@ class IntroController
Log::debug(sprintf('getIntroSteps for route "%s" and page "%s"', $route, $specificPage));
$steps = $this->getBasicSteps($route);
$specificSteps = $this->getSpecificSteps($route, $specificPage);
if (0 === count($specificSteps)) {
if (0 === \count($specificSteps)) {
Log::debug(sprintf('No specific steps for route "%s" and page "%s"', $route, $specificPage));
return response()->json($steps);
@@ -51,7 +51,7 @@ class IntroController
if ($this->hasOutroStep($route)) {
// @codeCoverageIgnoreStart
// save last step:
$lastStep = $steps[count($steps) - 1];
$lastStep = $steps[\count($steps) - 1];
// remove last step:
array_pop($steps);
// merge arrays and add last step again
@@ -136,7 +136,7 @@ class IntroController
$routeKey = str_replace('.', '_', $route);
$elements = config(sprintf('intro.%s', $routeKey));
$steps = [];
if (is_array($elements) && count($elements) > 0) {
if (\is_array($elements) && \count($elements) > 0) {
foreach ($elements as $key => $options) {
$currentStep = $options;
@@ -147,7 +147,7 @@ class IntroController
$steps[] = $currentStep;
}
}
Log::debug(sprintf('Total basic steps for %s is %d', $routeKey, count($steps)));
Log::debug(sprintf('Total basic steps for %s is %d', $routeKey, \count($steps)));
return $steps;
}
@@ -164,10 +164,10 @@ class IntroController
$routeKey = '';
// user is on page with specific instructions:
if (strlen($specificPage) > 0) {
if (\strlen($specificPage) > 0) {
$routeKey = str_replace('.', '_', $route);
$elements = config(sprintf('intro.%s', $routeKey . '_' . $specificPage));
if (is_array($elements) && count($elements) > 0) {
if (\is_array($elements) && \count($elements) > 0) {
foreach ($elements as $key => $options) {
$currentStep = $options;
@@ -179,7 +179,7 @@ class IntroController
}
}
}
Log::debug(sprintf('Total specific steps for route "%s" and page "%s" (routeKey is "%s") is %d', $route, $specificPage, $routeKey, count($steps)));
Log::debug(sprintf('Total specific steps for route "%s" and page "%s" (routeKey is "%s") is %d', $route, $specificPage, $routeKey, \count($steps)));
return $steps;
}