Some generic code refactoring.

This commit is contained in:
James Cole
2019-06-21 19:10:02 +02:00
parent fb1af395f9
commit 2d3d7f7720
67 changed files with 920 additions and 603 deletions

View File

@@ -55,7 +55,7 @@ class BudgetList implements BinderInterface
->get();
// add empty budget if applicable.
if (\in_array(0, $list, true)) {
if (in_array(0, $list, true)) {
$collection->push(new Budget);
}

View File

@@ -54,7 +54,7 @@ class CategoryList implements BinderInterface
->get();
// add empty category if applicable.
if (\in_array(0, $list, true)) {
if (in_array(0, $list, true)) {
$collection->push(new Category);
}

View File

@@ -43,7 +43,7 @@ class ConfigurationName implements BinderInterface
public static function routeBinder(string $value, Route $route): string
{
$accepted = ['is_demo_site', 'permission_update_check', 'single_user_mode'];
if (\in_array($value, $accepted, true)) {
if (in_array($value, $accepted, true)) {
return $value;
}
throw new NotFoundHttpException;

View File

@@ -24,7 +24,7 @@ namespace FireflyIII\Support\Binder;
use Carbon\Carbon;
use Exception;
use FireflyIII\Helpers\FiscalHelperInterface;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use Illuminate\Routing\Route;
use Log;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

View File

@@ -93,7 +93,7 @@ class ImportProvider implements BinderInterface
public static function routeBinder(string $value, Route $route): string
{
$providers = array_keys(self::getProviders());
if (\in_array($value, $providers, true)) {
if (in_array($value, $providers, true)) {
return $value;
}
throw new NotFoundHttpException;

View File

@@ -57,10 +57,10 @@ class TagList implements BinderInterface
$collection = $allTags->filter(
function (Tag $tag) use ($list) {
if (\in_array(strtolower($tag->tag), $list, true)) {
if (in_array(strtolower($tag->tag), $list, true)) {
return true;
}
if (\in_array((string)$tag->id, $list, true)) {
if (in_array((string)$tag->id, $list, true)) {
return true;
}