mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 13:36:15 +00:00
Code cleanup. [skip ci]
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user