Skip to content

Commit

Permalink
removed unused use clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
shrink0r committed Sep 30, 2016
1 parent c5dfd2b commit 5db494a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/StateMachine.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Workflux;

use Ds\Map;
use Ds\Vector;
use Workflux\Error\CorruptExecutionFlow;
use Workflux\Error\InvalidWorkflowStructure;
Expand Down Expand Up @@ -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;
Expand All @@ -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. ".
Expand Down
1 change: 0 additions & 1 deletion src/StateMachineInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Workflux\State\StateInterface;
use Workflux\State\StateMap;
use Workflux\Transition\StateTransitions;
use Workflux\Transition\TransitionSet;

interface StateMachineInterface
{
Expand Down

0 comments on commit 5db494a

Please sign in to comment.