mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 14:41:20 +00:00
Various code cleanup.
This commit is contained in:
@@ -67,6 +67,7 @@ final class Processor
|
||||
* @param bool $includeActions
|
||||
*
|
||||
* @return Processor
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public static function make(Rule $rule, $includeActions = true)
|
||||
{
|
||||
@@ -229,6 +230,7 @@ final class Processor
|
||||
* Run the actions
|
||||
*
|
||||
* @return bool
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
private function actions()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,6 @@ use FireflyIII\Helpers\Collector\JournalCollectorInterface;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Journal\JournalTaskerInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
|
||||
@@ -42,29 +41,18 @@ class TransactionMatcher
|
||||
private $range = 200;
|
||||
/** @var Rule The rule to apply */
|
||||
private $rule;
|
||||
/** @var JournalTaskerInterface Tasker for some related tasks */
|
||||
private $tasker;
|
||||
/** @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 = [];
|
||||
|
||||
/**
|
||||
* TransactionMatcher constructor. Typehint the repository.
|
||||
*
|
||||
* @param JournalTaskerInterface $tasker
|
||||
*/
|
||||
public function __construct(JournalTaskerInterface $tasker)
|
||||
{
|
||||
$this->tasker = $tasker;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* triggers onto each transaction journal until enough matches are found ($limit).
|
||||
*
|
||||
* @return Collection
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function findTransactionsByRule()
|
||||
{
|
||||
@@ -89,6 +77,7 @@ class TransactionMatcher
|
||||
* triggers onto each transaction journal until enough matches are found ($limit).
|
||||
*
|
||||
* @return Collection
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function findTransactionsByTriggers(): Collection
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ use FireflyIII\Models\TransactionJournal;
|
||||
* This class will be magical!
|
||||
*
|
||||
* Class AbstractTrigger
|
||||
* @method triggered
|
||||
* @method bool triggered($object)
|
||||
*/
|
||||
class AbstractTrigger
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user