mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Code cleanup
This commit is contained in:
@@ -201,7 +201,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
case Emoticon::class:
|
||||
case Emoji::class:
|
||||
case Mention::class:
|
||||
$allWords = (string)$searchNode->getValue();
|
||||
$allWords = (string) $searchNode->getValue();
|
||||
app('log')->debug(sprintf('Add words "%s" to search string, because Node class is "%s"', $allWords, $class));
|
||||
$this->words[] = $allWords;
|
||||
|
||||
@@ -231,11 +231,11 @@ class OperatorQuerySearch implements SearchInterface
|
||||
// must be valid operator:
|
||||
if (
|
||||
in_array($operator, $this->validOperators, true)
|
||||
&& $this->updateCollector($operator, (string)$value, $prohibited)) {
|
||||
&& $this->updateCollector($operator, (string) $value, $prohibited)) {
|
||||
$this->operators->push(
|
||||
[
|
||||
'type' => self::getRootOperator($operator),
|
||||
'value' => (string)$value,
|
||||
'value' => (string) $value,
|
||||
'prohibited' => $prohibited,
|
||||
]
|
||||
);
|
||||
@@ -245,7 +245,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
app('log')->debug(sprintf('Added INVALID operator type "%s"', $operator));
|
||||
$this->invalidOperators[] = [
|
||||
'type' => $operator,
|
||||
'value' => (string)$value,
|
||||
'value' => (string) $value,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -445,7 +445,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
break;
|
||||
|
||||
case 'source_account_id':
|
||||
$account = $this->accountRepository->find((int)$value);
|
||||
$account = $this->accountRepository->find((int) $value);
|
||||
if (null !== $account) {
|
||||
$this->collector->setSourceAccounts(new Collection([$account]));
|
||||
}
|
||||
@@ -457,7 +457,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
break;
|
||||
|
||||
case '-source_account_id':
|
||||
$account = $this->accountRepository->find((int)$value);
|
||||
$account = $this->accountRepository->find((int) $value);
|
||||
if (null !== $account) {
|
||||
$this->collector->excludeSourceAccounts(new Collection([$account]));
|
||||
}
|
||||
@@ -573,7 +573,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
break;
|
||||
|
||||
case 'destination_account_id':
|
||||
$account = $this->accountRepository->find((int)$value);
|
||||
$account = $this->accountRepository->find((int) $value);
|
||||
if (null !== $account) {
|
||||
$this->collector->setDestinationAccounts(new Collection([$account]));
|
||||
}
|
||||
@@ -584,7 +584,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
break;
|
||||
|
||||
case '-destination_account_id':
|
||||
$account = $this->accountRepository->find((int)$value);
|
||||
$account = $this->accountRepository->find((int) $value);
|
||||
if (null !== $account) {
|
||||
$this->collector->excludeDestinationAccounts(new Collection([$account]));
|
||||
}
|
||||
@@ -598,7 +598,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$parts = explode(',', $value);
|
||||
$collection = new Collection();
|
||||
foreach ($parts as $accountId) {
|
||||
$account = $this->accountRepository->find((int)$accountId);
|
||||
$account = $this->accountRepository->find((int) $accountId);
|
||||
if (null !== $account) {
|
||||
$collection->push($account);
|
||||
}
|
||||
@@ -616,7 +616,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$parts = explode(',', $value);
|
||||
$collection = new Collection();
|
||||
foreach ($parts as $accountId) {
|
||||
$account = $this->accountRepository->find((int)$accountId);
|
||||
$account = $this->accountRepository->find((int) $accountId);
|
||||
if (null !== $account) {
|
||||
$collection->push($account);
|
||||
}
|
||||
@@ -2003,7 +2003,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$filtered = $accounts->filter(
|
||||
static function (Account $account) use ($value, $stringMethod) {
|
||||
// either IBAN or account number
|
||||
$ibanMatch = $stringMethod(strtolower((string)$account->iban), strtolower($value));
|
||||
$ibanMatch = $stringMethod(strtolower((string) $account->iban), strtolower($value));
|
||||
$accountNrMatch = false;
|
||||
|
||||
/** @var AccountMeta $meta */
|
||||
@@ -2777,7 +2777,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$this->collector->setUser($user);
|
||||
$this->collector->withAccountInformation()->withCategoryInformation()->withBudgetInformation();
|
||||
|
||||
$this->setLimit((int)app('preferences')->getForUser($user, 'listPageSize', 50)->data);
|
||||
$this->setLimit((int) app('preferences')->getForUser($user, 'listPageSize', 50)->data);
|
||||
}
|
||||
|
||||
public function setLimit(int $limit): void
|
||||
|
Reference in New Issue
Block a user