mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some generic code refactoring.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user