Refactor rule processor so it's testable.

This commit is contained in:
James Cole
2018-08-24 17:57:34 +02:00
parent 850a0ae17e
commit 835a421909
10 changed files with 202 additions and 122 deletions

View File

@@ -135,7 +135,9 @@ class ImportArrayStorage
$rules->each(
function (Rule $rule) use ($journal) {
Log::debug(sprintf('Going to apply rule #%d to journal %d.', $rule->id, $journal->id));
$processor = Processor::make($rule);
/** @var Processor $processor */
$processor = app(Processor::class);
$processor->make($rule);
$processor->handleTransactionJournal($journal);
if ($rule->stop_processing) {
return false;