Created
March 26, 2013 11:40
-
-
Save zerkalica/5244775 to your computer and use it in GitHub Desktop.
This file contains 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
services: | |
millwright_cqrs.command_bus_proto: | |
class: Millwright\CQRSDomain\Bus\Bus | |
arguments: | |
- [] | |
- true | |
millwright_cqrs.message_bus_proto: | |
class: Millwright\CQRSDomain\Bus\Bus | |
arguments: | |
- [] | |
- false | |
millwright_cqrs.command_bus: | |
class: Millwright\CQRSDomain\Bus\BusDefferer | |
arguments: | |
- @service_container | |
- 'millwright_cqrs.command_bus_proto' | |
millwright_cqrs.message_bus: | |
class: Millwright\CQRSDomain\Bus\BusDefferer | |
arguments: | |
- @service_container | |
- 'millwright_cqrs.message_bus_proto' |
This file contains 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 | |
class BusDefferer implements BusInterface | |
{ | |
protected $container; | |
protected $serviceName; | |
public function __construct(ContainerInterface $container, $serviceName) | |
{ | |
$this->container = $container; | |
$this->serviceName = $serviceName; | |
} | |
/** | |
* {@inheritDoc} | |
*/ | |
public function handle() | |
{ | |
return call_user_func_array([$this->container->get($this->serviceName), __FUNCTION__], func_get_args()); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment