mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-22 11:11:25 +00:00
Fix #2422
This commit is contained in:
@@ -181,10 +181,10 @@ class SelectController extends Controller
|
|||||||
|
|
||||||
// Warn the user if only a subset of transactions is returned
|
// Warn the user if only a subset of transactions is returned
|
||||||
$warning = '';
|
$warning = '';
|
||||||
if ($matchingTransactions->count() === $limit) {
|
if (count($matchingTransactions) === $limit) {
|
||||||
$warning = (string)trans('firefly.warning_transaction_subset', ['max_num_transactions' => $limit]); // @codeCoverageIgnore
|
$warning = (string)trans('firefly.warning_transaction_subset', ['max_num_transactions' => $limit]); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
if (0 === $matchingTransactions->count()) {
|
if (0 === count($matchingTransactions)) {
|
||||||
$warning = (string)trans('firefly.warning_no_matching_transactions', ['num_transactions' => $range]); // @codeCoverageIgnore
|
$warning = (string)trans('firefly.warning_no_matching_transactions', ['num_transactions' => $range]); // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,10 +107,10 @@ class TransactionMatcher
|
|||||||
* transaction journals matching the given $triggers. This is accomplished by trying to fire these
|
* transaction journals matching the given $triggers. This is accomplished by trying to fire these
|
||||||
* triggers onto each transaction journal until enough matches are found ($limit).
|
* triggers onto each transaction journal until enough matches are found ($limit).
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return array
|
||||||
* @throws \FireflyIII\Exceptions\FireflyException
|
* @throws \FireflyIII\Exceptions\FireflyException
|
||||||
*/
|
*/
|
||||||
public function findTransactionsByTriggers(): Collection
|
public function findTransactionsByTriggers(): array
|
||||||
{
|
{
|
||||||
if (0 === count($this->triggers)) {
|
if (0 === count($this->triggers)) {
|
||||||
return new Collection;
|
return new Collection;
|
||||||
@@ -125,9 +125,7 @@ class TransactionMatcher
|
|||||||
|
|
||||||
// If the list of matchingTransactions is larger than the maximum number of results
|
// If the list of matchingTransactions is larger than the maximum number of results
|
||||||
// (e.g. if a large percentage of the transactions match), truncate the list
|
// (e.g. if a large percentage of the transactions match), truncate the list
|
||||||
$result = $result->slice(0, $this->searchLimit);
|
return array_slice($result, 0, $this->searchLimit);
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -251,7 +249,7 @@ class TransactionMatcher
|
|||||||
*
|
*
|
||||||
* @param Processor $processor
|
* @param Processor $processor
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function runProcessor(Processor $processor): array
|
private function runProcessor(Processor $processor): array
|
||||||
{
|
{
|
||||||
@@ -265,7 +263,7 @@ class TransactionMatcher
|
|||||||
// - all transactions have been fetched from the database
|
// - all transactions have been fetched from the database
|
||||||
// - the maximum number of transactions to return has been found
|
// - the maximum number of transactions to return has been found
|
||||||
// - the maximum number of transactions to search in have been searched
|
// - the maximum number of transactions to search in have been searched
|
||||||
$pageSize = min($this->searchLimit, min($this->triggeredLimit, 50));
|
$pageSize = $this->searchLimit;
|
||||||
$processed = 0;
|
$processed = 0;
|
||||||
$page = 1;
|
$page = 1;
|
||||||
$totalResult = [];
|
$totalResult = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user