Created
July 30, 2015 10:12
-
-
Save frankdejonge/c114cb80ba55410c727d to your computer and use it in GitHub Desktop.
Subdispatching commandbus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface Subdispatchable {}; | |
class SubdispatchingCommandBus extends CommandBus | |
{ | |
public function handle($command) | |
{ | |
$response = parent::handle($command); | |
if ( ! $response instanceof Subdispatchable) { | |
return $response; | |
} | |
return $this->handle($response); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment