Skip to content

Commit

Permalink
[PageFlow] Renamed the FSMBuilder::$flow field to $pageFlow. (Issue p…
Browse files Browse the repository at this point in the history
  • Loading branch information
iteman committed Sep 18, 2012
1 parent c7d80de commit 9627bcf
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/Piece/Flow/PageFlow/FSMBuilder.php
Expand Up @@ -53,7 +53,10 @@
*/
class FSMBuilder
{
protected $flow;
/**
* @var \Piece\Flow\PageFlow\PageFlow
*/
protected $pageFlow;

/**
* @var \Stagehand\FSM\FSMBuilder
Expand All @@ -70,18 +73,18 @@ class FSMBuilder
/**
* Sets a PageFlow object to the property.
*
* @param \Piece\Flow\PageFlow\PageFlow $flow
* @param \Piece\Flow\PageFlow\PageFlow $pageFlow
* @param string $definitionFile
* @throws \Piece\Flow\PageFlow\FileNotFoundException
*/
public function __construct(PageFlow $flow, $definitionFile)
public function __construct(PageFlow $pageFlow, $definitionFile)
{
if (!file_exists($definitionFile)) {
throw new FileNotFoundException(sprintf('The flow definition file [ %s ] is not found.', $definitionFile));
}

$this->definitionFile = $definitionFile;
$this->flow = $flow;
$this->pageFlow = $pageFlow;
$this->fsmBuilder = new \Stagehand\FSM\FSMBuilder();
}

Expand Down Expand Up @@ -112,8 +115,8 @@ public function build()

$this->fsmBuilder->addTransition($definition['lastState']['name'], Event::EVENT_END, State::STATE_FINAL);
$this->configureViewState($definition['lastState']);
$this->flow->setLastState($definition['lastState']['name']);
$this->flow->addView($definition['lastState']['name'], $definition['lastState']['view']);
$this->pageFlow->setLastState($definition['lastState']['name']);
$this->pageFlow->addView($definition['lastState']['name'], $definition['lastState']['view']);
}

$this->configureViewStates($definition['viewState']);
Expand All @@ -127,7 +130,7 @@ public function build()
$this->fsmBuilder->setEntryAction(State::STATE_FINAL, $this->wrapAction($definition['final']));
}

$this->flow->setFSM($this->fsmBuilder->getFSM());
$this->pageFlow->setFSM($this->fsmBuilder->getFSM());
}

/**
Expand All @@ -144,7 +147,7 @@ protected function configureViewStates(array $states)
}

$this->configureViewState($state);
$this->flow->addView($state['name'], $state['view']);
$this->pageFlow->addView($state['name'], $state['view']);
}
}

Expand Down Expand Up @@ -227,7 +230,7 @@ protected function wrapAction(array $action = null)
$actionID = $action['class'] . ':' . $action['method'];
}

$eventHandler = new EventHandler($actionID, $this->flow);
$eventHandler = new EventHandler($actionID, $this->pageFlow);
return array($eventHandler, 'invokeAction');
}

Expand Down Expand Up @@ -261,7 +264,7 @@ protected function wrapEventTriggerAction(array $action = null)
$actionID = $action['class'] . ':' . $action['method'];
}

$eventHandler = new EventHandler($actionID, $this->flow);
$eventHandler = new EventHandler($actionID, $this->pageFlow);
return array($eventHandler, 'invokeActionAndTriggerEvent');
}

Expand Down

0 comments on commit 9627bcf

Please sign in to comment.