Various code cleanup.

This commit is contained in:
James Cole
2018-03-11 16:24:07 +01:00
parent 5a7b1ba292
commit b12872e5de
40 changed files with 114 additions and 229 deletions

View File

@@ -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()
{

View File

@@ -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
{

View File

@@ -29,7 +29,7 @@ use FireflyIII\Models\TransactionJournal;
* This class will be magical!
*
* Class AbstractTrigger
* @method triggered
* @method bool triggered($object)
*/
class AbstractTrigger
{