mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various issues fixed (SonarQube)
This commit is contained in:
@@ -128,7 +128,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
->where('account_meta.name', 'account_number')
|
||||
->where('account_meta.data', json_encode($number));
|
||||
|
||||
if (count($types) > 0) {
|
||||
if (!empty($types)) {
|
||||
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
{
|
||||
$query = $this->user->accounts()->where('iban', '!=', '')->whereNotNull('iban');
|
||||
|
||||
if (count($types) > 0) {
|
||||
if (!empty($types)) {
|
||||
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
{
|
||||
$query = $this->user->accounts();
|
||||
|
||||
if (count($types) > 0) {
|
||||
if (!empty($types)) {
|
||||
$query->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$query->whereIn('account_types.type', $types);
|
||||
}
|
||||
@@ -260,7 +260,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
/** @var Collection $result */
|
||||
$query = $this->user->accounts();
|
||||
|
||||
if (count($accountIds) > 0) {
|
||||
if (!empty($accountIds)) {
|
||||
$query->whereIn('accounts.id', $accountIds);
|
||||
}
|
||||
$query->orderBy('accounts.order', 'ASC');
|
||||
@@ -279,7 +279,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
{
|
||||
/** @var Collection $result */
|
||||
$query = $this->user->accounts();
|
||||
if (count($types) > 0) {
|
||||
if (!empty($types)) {
|
||||
$query->accountTypeIn($types);
|
||||
}
|
||||
$query->orderBy('accounts.order', 'ASC');
|
||||
@@ -303,7 +303,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$query->where('name', 'account_role');
|
||||
}, 'attachments']
|
||||
);
|
||||
if (count($types) > 0) {
|
||||
if (!empty($types)) {
|
||||
$query->accountTypeIn($types);
|
||||
}
|
||||
$query->where('active', 1);
|
||||
@@ -572,7 +572,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
}
|
||||
|
||||
}
|
||||
if (count($types) > 0) {
|
||||
if (!empty($types)) {
|
||||
$dbQuery->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$dbQuery->whereIn('account_types.type', $types);
|
||||
}
|
||||
@@ -630,7 +630,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$query->where('name', 'account_role');
|
||||
}]
|
||||
);
|
||||
if (count($types) > 0) {
|
||||
if (!empty($types)) {
|
||||
$query->accountTypeIn($types);
|
||||
}
|
||||
$query->where('active', 0);
|
||||
@@ -728,7 +728,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
});
|
||||
}
|
||||
}
|
||||
if (count($types) > 0) {
|
||||
if (!empty($types)) {
|
||||
$dbQuery->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id');
|
||||
$dbQuery->whereIn('account_types.type', $types);
|
||||
}
|
||||
|
Reference in New Issue
Block a user