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

@@ -50,7 +50,7 @@ class AccountList implements BinderInterface
$list[] = (int)$entry;
}
$list = array_unique($list);
if (count($list) === 0) {
if (\count($list) === 0) {
Log::error('Account list is empty.');
throw new NotFoundHttpException; // @codeCoverageIgnore
}

View File

@@ -48,7 +48,7 @@ class BudgetList implements BinderInterface
$list[] = (int)$entry;
}
$list = array_unique($list);
if (count($list) === 0) {
if (\count($list) === 0) {
throw new NotFoundHttpException; // @codeCoverageIgnore
}
@@ -59,7 +59,7 @@ class BudgetList implements BinderInterface
->get();
// add empty budget if applicable.
if (in_array(0, $list)) {
if (\in_array(0, $list)) {
$collection->push(new Budget);
}

View File

@@ -48,7 +48,7 @@ class CategoryList implements BinderInterface
$list[] = (int)$entry;
}
$list = array_unique($list);
if (count($list) === 0) {
if (\count($list) === 0) {
throw new NotFoundHttpException; // @codeCoverageIgnore
}
@@ -58,7 +58,7 @@ class CategoryList implements BinderInterface
->get();
// add empty category if applicable.
if (in_array(0, $list)) {
if (\in_array(0, $list)) {
$collection->push(new Category);
}

View File

@@ -47,7 +47,7 @@ class JournalList implements BinderInterface
$list[] = (int)$entry;
}
$list = array_unique($list);
if (count($list) === 0) {
if (\count($list) === 0) {
throw new NotFoundHttpException; // @codeCoverageIgnore
}

View File

@@ -50,7 +50,7 @@ class TagList implements BinderInterface
$list[] = strtolower(trim($entry));
}
$list = array_unique($list);
if (count($list) === 0) {
if (\count($list) === 0) {
Log::error('Tag list is empty.');
throw new NotFoundHttpException; // @codeCoverageIgnore
}
@@ -61,7 +61,7 @@ class TagList implements BinderInterface
$collection = $allTags->filter(
function (Tag $tag) use ($list) {
return in_array(strtolower($tag->tag), $list);
return \in_array(strtolower($tag->tag), $list);
}
);