Reformat various code.

This commit is contained in:
James Cole
2022-03-29 14:59:58 +02:00
parent 29bed2547c
commit d1a09ff33b
115 changed files with 2700 additions and 2699 deletions

View File

@@ -37,14 +37,13 @@ class AccountSearch implements GenericSearchInterface
/** @var string */
public const SEARCH_ALL = 'all';
/** @var string */
public const SEARCH_NAME = 'name';
/** @var string */
public const SEARCH_IBAN = 'iban';
/** @var string */
public const SEARCH_NUMBER = 'number';
/** @var string */
public const SEARCH_ID = 'id';
/** @var string */
public const SEARCH_NAME = 'name';
/** @var string */
public const SEARCH_NUMBER = 'number';
private string $field;
private string $query;
private array $types;
@@ -62,11 +61,11 @@ class AccountSearch implements GenericSearchInterface
public function search(): Collection
{
$searchQuery = $this->user->accounts()
->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id')
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
->whereIn('account_types.type', $this->types);
$like = sprintf('%%%s%%', $this->query);
$searchQuery = $this->user->accounts()
->leftJoin('account_types', 'accounts.account_type_id', '=', 'account_types.id')
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
->whereIn('account_types.type', $this->types);
$like = sprintf('%%%s%%', $this->query);
$originalQuery = $this->query;
switch ($this->field) {
default:
@@ -88,7 +87,7 @@ class AccountSearch implements GenericSearchInterface
);
break;
case self::SEARCH_ID:
$searchQuery->where('accounts.id', '=', (int)$originalQuery);
$searchQuery->where('accounts.id', '=', (int) $originalQuery);
break;
case self::SEARCH_NAME:
$searchQuery->where('accounts.name', 'LIKE', $like);