mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Fix final tests
This commit is contained in:
@@ -48,35 +48,18 @@ class TransactionMatcher
|
||||
private $range = 200;
|
||||
/** @var Rule The rule to apply */
|
||||
private $rule;
|
||||
/** @var bool */
|
||||
private $strict;
|
||||
/** @var array Types that can be matched using this matcher */
|
||||
private $transactionTypes = [TransactionType::DEPOSIT, TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
|
||||
/** @var array List of triggers to match */
|
||||
private $triggers = [];
|
||||
/** @var bool */
|
||||
private $strict;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->strict = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isStrict(): bool
|
||||
{
|
||||
return $this->strict;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $strict
|
||||
*/
|
||||
public function setStrict(bool $strict): void
|
||||
{
|
||||
$this->strict = $strict;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method will search the user's transaction journal (with an upper limit of $range) for
|
||||
* transaction journals matching the given rule. This is accomplished by trying to fire these
|
||||
@@ -92,8 +75,10 @@ class TransactionMatcher
|
||||
}
|
||||
|
||||
// Variables used within the loop
|
||||
$processor = Processor::make($this->rule, false);
|
||||
$result = $this->runProcessor($processor);
|
||||
/** @var Processor $processor */
|
||||
$processor = app(Processor::class);
|
||||
$processor->make($this->rule, false);
|
||||
$result = $this->runProcessor($processor);
|
||||
|
||||
// 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
|
||||
@@ -202,6 +187,22 @@ class TransactionMatcher
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isStrict(): bool
|
||||
{
|
||||
return $this->strict;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $strict
|
||||
*/
|
||||
public function setStrict(bool $strict): void
|
||||
{
|
||||
$this->strict = $strict;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set rule
|
||||
*
|
||||
|
Reference in New Issue
Block a user