mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Code cleanup.
This commit is contained in:
@@ -30,8 +30,6 @@ use FireflyIII\TransactionRules\Actions\ActionInterface;
|
||||
|
||||
/**
|
||||
* Class ActionFactory can create actions.
|
||||
*
|
||||
|
||||
*/
|
||||
class ActionFactory
|
||||
{
|
||||
@@ -44,10 +42,6 @@ class ActionFactory
|
||||
* with value "Groceries" this method will return a corresponding SetCategory object preset
|
||||
* to "Groceries". Any transaction journal then fed to this object will have its category changed.
|
||||
*
|
||||
* @param RuleAction $action
|
||||
*
|
||||
* @return ActionInterface
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public static function getAction(RuleAction $action): ActionInterface
|
||||
@@ -63,10 +57,6 @@ class ActionFactory
|
||||
* that will match the given action type (ie. "change_category") to the matching class name
|
||||
* (SetCategory) using the configuration (firefly.php).
|
||||
*
|
||||
* @param string $actionType
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public static function getActionClass(string $actionType): string
|
||||
@@ -74,12 +64,12 @@ class ActionFactory
|
||||
$actionTypes = self::getActionTypes();
|
||||
|
||||
if (!array_key_exists($actionType, $actionTypes)) {
|
||||
throw new FireflyException('No such action exists ("' . e($actionType) . '").');
|
||||
throw new FireflyException('No such action exists ("'.e($actionType).'").');
|
||||
}
|
||||
|
||||
$class = $actionTypes[$actionType];
|
||||
if (!class_exists($class)) {
|
||||
throw new FireflyException('Could not instantiate class for rule action type "' . e($actionType) . '" (' . e($class) . ').');
|
||||
throw new FireflyException('Could not instantiate class for rule action type "'.e($actionType).'" ('.e($class).').');
|
||||
}
|
||||
|
||||
return $class;
|
||||
@@ -87,8 +77,6 @@ class ActionFactory
|
||||
|
||||
/**
|
||||
* Returns a map with actiontypes, mapped to the class representing that type.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function getActionTypes(): array
|
||||
{
|
||||
|
Reference in New Issue
Block a user