Skip to content

Commit

Permalink
Fix wrong type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Miertsch committed May 9, 2015
1 parent 59af6c7 commit a436c15
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -11,8 +11,10 @@

namespace Prooph\ServiceBus\InvokeStrategy;

use Prooph\ServiceBus\Message\RemoteMessageDispatcher;
use Prooph\Common\Messaging\RemoteMessage;
use Prooph\ServiceBus\Message\ProophDomainMessageToRemoteMessageTranslator;
use Prooph\ServiceBus\Message\RemoteMessageDispatcher;
use Prooph\ServiceBus\Message\ToRemoteMessageTranslator;

/**
* Class ForwardToRemoteMessageDispatcherStrategy
Expand All @@ -34,9 +36,7 @@ class ForwardToRemoteMessageDispatcherStrategy extends AbstractInvokeStrategy
/**
* @param ToRemoteMessageTranslator $messageTranslator
*/
public function __construct(
ProophDomainMessageToRemoteMessageTranslator $messageTranslator = null
)
public function __construct(ToRemoteMessageTranslator $messageTranslator = null)
{
$this->messageTranslator = $messageTranslator;
}
Expand All @@ -49,7 +49,7 @@ public function __construct(
protected function canInvoke($aHandler, $aCommandOrEvent)
{
if ($aHandler instanceof RemoteMessageDispatcher) {
if ($aCommandOrEvent instanceof MessageInterface
if ($aCommandOrEvent instanceof RemoteMessage
|| $this->getMessageTranslator()->canTranslateToRemoteMessage($aCommandOrEvent)) {
return true;
}
Expand All @@ -66,7 +66,7 @@ protected function invoke($aHandler, $aCommandOrEvent)
{
$message = $aCommandOrEvent;

if (! $message instanceof MessageInterface) {
if (! $message instanceof RemoteMessage) {
$message = $this->getMessageTranslator()->translateToRemoteMessage($aCommandOrEvent);
}

Expand Down

0 comments on commit a436c15

Please sign in to comment.