Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

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