Code cleanup. [skip ci]

This commit is contained in:
James Cole
2016-02-17 15:38:21 +01:00
parent 9cac61dc33
commit 0d44f82c86
17 changed files with 240 additions and 277 deletions

View File

@@ -23,6 +23,22 @@ class TriggerFactory
{
protected static $triggerTypes = null;
/**
* Returns the trigger for the given type and journal
*
* @param RuleTrigger $trigger
* @param TransactionJournal $journal
*
* @return TriggerInterface
*/
public static function getTrigger(RuleTrigger $trigger, TransactionJournal $journal): TriggerInterface
{
$triggerType = $trigger->trigger_type;
$class = self::getTriggerClass($triggerType);
return new $class($trigger, $journal);
}
/**
* Returns the class name to be used for triggers with the given name
*
@@ -47,22 +63,6 @@ class TriggerFactory
return $class;
}
/**
* Returns the trigger for the given type and journal
*
* @param RuleTrigger $trigger
* @param TransactionJournal $journal
*
* @return TriggerInterface
*/
public static function getTrigger(RuleTrigger $trigger, TransactionJournal $journal): TriggerInterface
{
$triggerType = $trigger->trigger_type;
$class = self::getTriggerClass($triggerType);
return new $class($trigger, $journal);
}
/**
* Returns a map with triggertypes, mapped to the class representing that type
*/