Skip to content

Commit

Permalink
[PageFlow] Renamed the InvalidTransitionException class to Incomplete…
Browse files Browse the repository at this point in the history
…TransitionException. (Issue piece#4)
  • Loading branch information
iteman committed Sep 18, 2012
1 parent 7ca2e22 commit 7e1df1c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Piece/Flow/PageFlow/IPageFlow.php
Expand Up @@ -83,7 +83,7 @@ public function getPreviousState();
* Gets the appropriate view string corresponding to the current state.
*
* @return string
* @throws \Piece\Flow\PageFlow\InvalidTransitionException
* @throws \Piece\Flow\PageFlow\IncompleteTransitionException
*/
public function getView();

Expand Down
Expand Up @@ -44,7 +44,7 @@
* @version Release: @package_version@
* @since Class available since Release 2.0.0
*/
class InvalidTransitionException extends \UnexpectedValueException
class IncompleteTransitionException extends \UnexpectedValueException
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Piece/Flow/PageFlow/PageFlow.php
Expand Up @@ -162,7 +162,7 @@ public function getView()

$state = $this->isInFinalState() ? $this->getPreviousState() : $this->getCurrentState();
if (!array_key_exists($state->getID(), $this->views)) {
throw new InvalidTransitionException(sprintf('An invalid transition detected. The state [ %s ] does not have a view. Maybe the state [ %s ] is an action state. Check the definition for [ %s ].', $state->getID(), $state->getID(), $this->getID()));
throw new IncompleteTransitionException(sprintf('An invalid transition detected. The state [ %s ] does not have a view. Maybe the state [ %s ] is an action state. Check the definition for [ %s ].', $state->getID(), $state->getID(), $this->getID()));
}

return $this->views[ $state->getID() ];
Expand Down
2 changes: 1 addition & 1 deletion test/Piece/Flow/PageFlow/PageFlowTest.php
Expand Up @@ -194,7 +194,7 @@ public function testInitialAndFinalActionsWithYAML()
}

/**
* @expectedException \Piece\Flow\PageFlow\InvalidTransitionException
* @expectedException \Piece\Flow\PageFlow\IncompleteTransitionException
*/
public function testInvalidTransition()
{
Expand Down

0 comments on commit 7e1df1c

Please sign in to comment.