Code optimalisations.

This commit is contained in:
James Cole
2018-07-05 21:18:53 +02:00
parent 1675a0d442
commit c99b7e927d
26 changed files with 216 additions and 150 deletions

View File

@@ -48,6 +48,7 @@ class ConfigurationController extends Controller
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @noinspection UnusedConstructorDependenciesInspection */
$this->repository = app(UserRepositoryInterface::class);
/** @var User $admin */
$admin = auth()->user();
@@ -62,9 +63,9 @@ class ConfigurationController extends Controller
}
/**
* @throws FireflyException
* @return JsonResponse
*/
public function index()
public function index(): JsonResponse
{
$configData = $this->getConfigData();
@@ -90,7 +91,7 @@ class ConfigurationController extends Controller
switch ($name) {
case 'is_demo_site':
case 'single_user_mode':
$configValue = $value === 'true';
$configValue = 'true' === $value;
break;
case 'permission_update_check':
$configValue = (int)$value >= -1 && (int)$value <= 1 ? (int)$value : -1;