diff --git a/src/StateMachine.php b/src/StateMachine.php index ed35652..331c1f3 100644 --- a/src/StateMachine.php +++ b/src/StateMachine.php @@ -2,7 +2,6 @@ namespace Workflux; -use Ds\Map; use Ds\Vector; use Workflux\Error\CorruptExecutionFlow; use Workflux\Error\InvalidWorkflowStructure; @@ -115,7 +114,6 @@ public function getStateTransitions(): StateTransitions */ public function execute(InputInterface $input, string $state_name): OutputInterface { - // @todo this needs to be configurable somehow; maybe a good ol' "define" or an "env var" might do? static $max_execution_cycles = 100; $bread_crumbs = new Vector; @@ -126,13 +124,9 @@ public function execute(InputInterface $input, string $state_name): OutputInterf $output = $next_state->execute($input); $next_state = $this->activateTransition($input, $output); $input = Input::fromOutput($output); - // @todo this needs a better runtime-cycle detetection than just counting max executions. - // maybe somehow use the bread-crumbs to find reoccuring path patterns? } while ($next_state && !$next_state->isBreakpoint() && count($bread_crumbs) < $max_execution_cycles); if (count($bread_crumbs) === $max_execution_cycles) { - // @todo would be nice to collapse recursive paths in the output - // in order to prevent the ridiculous length of the exception while still providing some insight. throw new CorruptExecutionFlow( "Trying to execute more than the allowed number of $max_execution_cycles workflow steps.\n". "It is likely that an intentional cycle inside the workflow isn't properly exiting. ". diff --git a/src/StateMachineInterface.php b/src/StateMachineInterface.php index fd8dc03..63309df 100644 --- a/src/StateMachineInterface.php +++ b/src/StateMachineInterface.php @@ -7,7 +7,6 @@ use Workflux\State\StateInterface; use Workflux\State\StateMap; use Workflux\Transition\StateTransitions; -use Workflux\Transition\TransitionSet; interface StateMachineInterface {