Skip to content

Commit

Permalink
renamed the interface ActionInvoker to ActionInvokerInterface (Issue p…
Browse files Browse the repository at this point in the history
  • Loading branch information
iteman committed Aug 2, 2013
1 parent 15b52aa commit 8086fff
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions src/Piece/Flow/Continuation/ContinuationServer.php
Expand Up @@ -37,7 +37,7 @@

namespace Piece\Flow\Continuation;

use Piece\Flow\PageFlow\ActionInvoker;
use Piece\Flow\PageFlow\ActionInvokerInterface;

/**
* The continuation server.
Expand All @@ -54,7 +54,7 @@ class ContinuationServer
protected $pageFlowInstanceRepository;

/**
* @var \Piece\Flow\PageFlow\ActionInvoker
* @var \Piece\Flow\PageFlow\ActionInvokerInterface
* @since Property available since Release 2.0.0
*/
protected $actionInvoker;
Expand Down Expand Up @@ -161,10 +161,10 @@ public function clear()
/**
* Sets the action invoker.
*
* @param \Piece\Flow\PageFlow\ActionInvoker $actionInvoker
* @param \Piece\Flow\PageFlow\ActionInvokerInterface $actionInvoker
* @since Method available since Release 2.0.0
*/
public function setActionInvoker(ActionInvoker $actionInvoker)
public function setActionInvoker(ActionInvokerInterface $actionInvoker)
{
$this->actionInvoker = $actionInvoker;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Piece/Flow/Continuation/NullPageFlow.php
Expand Up @@ -37,7 +37,7 @@

namespace Piece\Flow\Continuation;

use Piece\Flow\PageFlow\ActionInvoker;
use Piece\Flow\PageFlow\ActionInvokerInterface;
use Piece\Flow\PageFlow\PageFlowInterface;

/**
Expand Down Expand Up @@ -97,7 +97,7 @@ public function isInFinalState()
return false;
}

public function setActionInvoker(ActionInvoker $actionInvoker)
public function setActionInvoker(ActionInvokerInterface $actionInvoker)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Piece/Flow/Continuation/PageFlowInstance.php
Expand Up @@ -37,7 +37,7 @@

namespace Piece\Flow\Continuation;

use Piece\Flow\PageFlow\ActionInvoker;
use Piece\Flow\PageFlow\ActionInvokerInterface;
use Piece\Flow\PageFlow\PageFlow;
use Piece\Flow\PageFlow\PageFlowInterface;

Expand Down Expand Up @@ -135,7 +135,7 @@ public function isInFinalState()
return $this->pageFlow->isInFinalState();
}

public function setActionInvoker(ActionInvoker $actionInvoker)
public function setActionInvoker(ActionInvokerInterface $actionInvoker)
{
$this->pageFlow->setActionInvoker($actionInvoker);
}
Expand Down
Expand Up @@ -44,7 +44,7 @@
* @version Release: @package_version@
* @since Class available since Release 2.0.0
*/
interface ActionInvoker
interface ActionInvokerInterface
{
/**
* @param string $actionID
Expand Down
4 changes: 2 additions & 2 deletions src/Piece/Flow/PageFlow/PageFlow.php
Expand Up @@ -89,7 +89,7 @@ class PageFlow implements PageFlowInterface
protected $receivedValidEvent;

/**
* @var \Piece\Flow\PageFlow\ActionInvoker
* @var \Piece\Flow\PageFlow\ActionInvokerInterface
* @since Property available since Release 2.0.0
*/
protected $actionInvoker;
Expand Down Expand Up @@ -150,7 +150,7 @@ public function addEndState($stateID)
/**
* @since Method available since Release 2.0.0
*/
public function setActionInvoker(ActionInvoker $actionInvoker)
public function setActionInvoker(ActionInvokerInterface $actionInvoker)
{
$this->actionInvoker = $actionInvoker;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Piece/Flow/PageFlow/PageFlowInterface.php
Expand Up @@ -97,9 +97,9 @@ public function getCurrentView();
public function isInFinalState();

/**
* @param \Piece\Flow\PageFlow\ActionInvoker $actionInvoker
* @param \Piece\Flow\PageFlow\ActionInvokerInterface $actionInvoker
*/
public function setActionInvoker(ActionInvoker $actionInvoker);
public function setActionInvoker(ActionInvokerInterface $actionInvoker);

/**
* Sets a user defined payload.
Expand Down
6 changes: 3 additions & 3 deletions test/Piece/Flow/Continuation/ContinuationServerTest.php
Expand Up @@ -308,7 +308,7 @@ public function raisesAnExceptionWhenThePageFlowInstanceHasExpired($expirationTi
$pageFlowInstanceRepository = $this->createPageFlowInstanceRepository();
$pageFlowInstanceRepository->addPageFlow('Counter', false);
$continuationServer = new ContinuationServer($pageFlowInstanceRepository, new GC($expirationTime, $clock));
$continuationServer->setActionInvoker(\Phake::mock('Piece\Flow\PageFlow\ActionInvoker'));
$continuationServer->setActionInvoker(\Phake::mock('Piece\Flow\PageFlow\ActionInvokerInterface'));
$continuationServer->setContinuationContextProvider($this->continuationContextProvider);

$this->pageFlowID = 'Counter';
Expand Down Expand Up @@ -388,11 +388,11 @@ public function validatesTheLastReceivedEvent()
}

/**
* @return \Piece\Flow\PageFlow\ActionInvoker
* @return \Piece\Flow\PageFlow\ActionInvokerInterface
*/
protected function createCounterActionInvoker()
{
$actionInvoker = \Phake::mock('Piece\Flow\PageFlow\ActionInvoker');
$actionInvoker = \Phake::mock('Piece\Flow\PageFlow\ActionInvokerInterface');
\Phake::when($actionInvoker)->invoke('setup', $this->anything())->thenGetReturnByLambda(function ($actionID, EventContext $eventContext) {
$eventContext->getPageFlow()->getAttributes()->set('counter', 0);
});
Expand Down
10 changes: 5 additions & 5 deletions test/Piece/Flow/PageFlow/PageFlowTest.php
Expand Up @@ -66,7 +66,7 @@ protected function setUp()
public function getsTheViewOfTheCurrentState()
{
$pageFlow = $this->pageFlowFactory->create('Registration');
$pageFlow->setActionInvoker(\Phake::mock('Piece\Flow\PageFlow\ActionInvoker'));
$pageFlow->setActionInvoker(\Phake::mock('Piece\Flow\PageFlow\ActionInvokerInterface'));

$this->assertThat($pageFlow->getCurrentView(), $this->isNull());

Expand All @@ -80,7 +80,7 @@ public function getsTheViewOfTheCurrentState()
*/
public function triggersAnEvent()
{
$actionInvoker = \Phake::mock('Piece\Flow\PageFlow\ActionInvoker');
$actionInvoker = \Phake::mock('Piece\Flow\PageFlow\ActionInvokerInterface');
\Phake::when($actionInvoker)->invoke('onValidation', $this->anything())->thenReturn('valid');
\Phake::when($actionInvoker)->invoke('onRegistration', $this->anything())->thenReturn('done');
$pageFlow = $this->pageFlowFactory->create('Registration');
Expand Down Expand Up @@ -135,7 +135,7 @@ public function replacesATriggeredEventWithTheBuiltinEventForProtectedEventsIfTh
public function accessesTheAttributes()
{
$pageFlow = $this->pageFlowFactory->create('Registration');
$pageFlow->setActionInvoker(\Phake::mock('Piece\Flow\PageFlow\ActionInvoker'));
$pageFlow->setActionInvoker(\Phake::mock('Piece\Flow\PageFlow\ActionInvokerInterface'));
$pageFlow->start();
$pageFlow->getAttributes()->set('foo', 'bar');

Expand All @@ -151,7 +151,7 @@ public function accessesTheAttributes()
*/
public function raisesAnExceptionWhenThePageFlowDefinitionHasAProtectedEvent()
{
$this->pageFlowFactory->create('ProtectedEvent', \Phake::mock('Piece\Flow\PageFlow\ActionInvoker'));
$this->pageFlowFactory->create('ProtectedEvent', \Phake::mock('Piece\Flow\PageFlow\ActionInvokerInterface'));
}

/**
Expand All @@ -162,7 +162,7 @@ public function raisesAnExceptionWhenThePageFlowDefinitionHasAProtectedEvent()
*/
public function raisesAnExceptionWhenThePageFlowDefinitionHasAProtectedState()
{
$this->pageFlowFactory->create('ProtectedState', \Phake::mock('Piece\Flow\PageFlow\ActionInvoker'));
$this->pageFlowFactory->create('ProtectedState', \Phake::mock('Piece\Flow\PageFlow\ActionInvokerInterface'));
}
}

Expand Down

0 comments on commit 8086fff

Please sign in to comment.