| 1 | <?php |
||
| 6 | class Dispatcher |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var ContainerInterface |
||
| 10 | */ |
||
| 11 | private $container; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Dispatcher constructor. |
||
| 15 | * @param ContainerInterface $container |
||
| 16 | */ |
||
| 17 | 7 | public function __construct(ContainerInterface $container) |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Dispatches command |
||
| 24 | * |
||
| 25 | * @param mixed $command The command to dispatch. Can be a callable or object with a handle method. |
||
| 26 | * @param array $args Array of arguments to pass to the command |
||
| 27 | * |
||
| 28 | * @return mixed |
||
| 29 | * @throws \Interop\Container\Exception\ContainerException |
||
| 30 | * @throws \InvalidArgumentException |
||
| 31 | */ |
||
| 32 | 7 | public function dispatch($command, array $args = []) |
|
| 45 | } |
||
| 46 |