Skip to content

Commit

Permalink
simplify ExecutorFactory and unify
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Sep 6, 2023
1 parent b48701a commit eeaa67f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/UserAction/ExecutorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ protected function createActionTrigger(UserAction $action, string $type = null):
}
}

$seed = is_array($seed) && is_callable($seed) ? call_user_func($seed, $action, $type) : $seed;
if (is_array($seed) && is_callable($seed)) {
$seed = call_user_func($seed, $action, $type);
}

return Factory::factory($seed);
}
Expand Down Expand Up @@ -242,7 +244,11 @@ protected function getActionCaption(UserAction $action, string $type = null): st
}
}

return is_array($caption) && is_callable($caption) ? call_user_func($caption, $action) : $caption;
if (is_array($caption) && is_callable($caption)) {
$caption = call_user_func($caption, $action);
}

return $caption;
}

/**
Expand Down

0 comments on commit eeaa67f

Please sign in to comment.