From b8df2226ae082c2d4bc0770da1124fbecf4259eb Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 18 Feb 2016 06:38:37 +0100 Subject: [PATCH] New phpdoc. --- app/Rules/Factory/ActionFactory.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/Rules/Factory/ActionFactory.php b/app/Rules/Factory/ActionFactory.php index 22a2a982d7..7e40e92440 100644 --- a/app/Rules/Factory/ActionFactory.php +++ b/app/Rules/Factory/ActionFactory.php @@ -26,7 +26,10 @@ class ActionFactory protected static $actionTypes = null; /** - * Returns the action for the given type and journal + * This method returns the actual implementation (Rules/Action/[object]) for a given + * RuleAction (database object). If for example the database object contains action_type "change_category" + * 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 * @@ -34,18 +37,19 @@ class ActionFactory */ public static function getAction(RuleAction $action): ActionInterface { - $actionType = $action->action_type; - $class = self::getActionClass($actionType); + $class = self::getActionClass($action->action_type); return new $class($action); } /** - * Returns the class name to be used for actions with the given name + * Returns the class name to be used for actions with the given name. This is a lookup function + * 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 ActionInterface|string + * @return string * @throws FireflyException */ public static function getActionClass(string $actionType): string