mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-28 18:51:55 +00:00
Various code fixes.
This commit is contained in:
@@ -54,7 +54,7 @@ class BudgetList implements BinderInterface
|
||||
$list = array_unique(array_map('\intval', explode(',', $value)));
|
||||
|
||||
|
||||
if (empty($list)) {
|
||||
if (0 === count($list)) {
|
||||
app('log')->warning('Budget list count is zero, return 404.');
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class CategoryList implements BinderInterface
|
||||
}
|
||||
|
||||
$list = array_unique(array_map('\intval', explode(',', $value)));
|
||||
if (empty($list)) {
|
||||
if (0 === count($list)) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
|
@@ -52,7 +52,7 @@ class JournalList implements BinderInterface
|
||||
$collector->withCategoryInformation()->withBudgetInformation()->withTagInformation()->withAccountInformation();
|
||||
$collector->setJournalIds($list);
|
||||
$result = $collector->getExtractedJournals();
|
||||
if (empty($result)) {
|
||||
if (0 === count($result)) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class JournalList implements BinderInterface
|
||||
protected static function parseList(string $value): array
|
||||
{
|
||||
$list = array_unique(array_map('\intval', explode(',', $value)));
|
||||
if (empty($list)) {
|
||||
if (0 === count($list)) {
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
|
@@ -52,7 +52,7 @@ class TagList implements BinderInterface
|
||||
$list = array_unique(array_map('\strtolower', explode(',', $value)));
|
||||
Log::debug('List of tags is', $list);
|
||||
|
||||
if (empty($list)) {
|
||||
if (0 === count($list)) {
|
||||
Log::error('Tag list is empty.');
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
@@ -767,7 +767,7 @@ class ExportDataGenerator
|
||||
*/
|
||||
private function mergeTags(array $tags): string
|
||||
{
|
||||
if (empty($tags)) {
|
||||
if (0 === count($tags)) {
|
||||
return '';
|
||||
}
|
||||
$smol = [];
|
||||
|
@@ -1993,7 +1993,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
*/
|
||||
public function searchTransactions(): LengthAwarePaginator
|
||||
{
|
||||
if (empty($this->getWords()) && empty($this->getOperators())) {
|
||||
if (0 === count($this->getWords()) && 0 === count($this->getOperators())) {
|
||||
return new LengthAwarePaginator([], 0, 5, 1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user