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

@@ -41,9 +41,7 @@ trait BasicDataSupport
*/
protected function isInArray(array $array, int $entryId) // helper for data (math, calculations)
{
$result = $array[$entryId] ?? '0';
return $result;
return $array[$entryId] ?? '0';
}

View File

@@ -50,9 +50,7 @@ trait DateCalculation
if ($start->lte($today) && $end->gte($today)) {
$difference = $today->diffInDays($end);
}
$difference = 0 === $difference ? 1 : $difference;
return $difference;
return 0 === $difference ? 1 : $difference;
}
/**

View File

@@ -51,9 +51,7 @@ trait GetConfigurationData
E_ALL & ~E_NOTICE & ~E_STRICT => 'E_ALL & ~E_NOTICE & ~E_STRICT',
E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR => 'E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR',
];
$result = $array[$value] ?? (string)$value;
return $result;
return $array[$value] ?? (string)$value;
}
/**
@@ -150,7 +148,7 @@ trait GetConfigurationData
$index = (string)trans('firefly.everything');
$ranges[$index] = [$first, new Carbon];
$return = [
return [
'title' => $title,
'configuration' => [
'apply' => (string)trans('firefly.apply'),
@@ -163,8 +161,6 @@ trait GetConfigurationData
'ranges' => $ranges,
],
];
return $return;
}
/**

View File

@@ -98,9 +98,7 @@ trait RequestInformation
// also check cache first:
if ($help->inCache($route, $language)) {
Log::debug(sprintf('Help text %s was in cache.', $language));
$content = $help->getFromCache($route, $language);
return $content;
return $help->getFromCache($route, $language);
}
$baseHref = route('index');
$helpString = sprintf(