Dispatcher.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace Illuminate\Contracts\Bus;
  3. interface Dispatcher
  4. {
  5. /**
  6. * Dispatch a command to its appropriate handler.
  7. *
  8. * @param mixed $command
  9. * @return mixed
  10. */
  11. public function dispatch($command);
  12. /**
  13. * Dispatch a command to its appropriate handler in the current process.
  14. *
  15. * @param mixed $command
  16. * @param mixed $handler
  17. * @return mixed
  18. */
  19. public function dispatchNow($command, $handler = null);
  20. /**
  21. * Determine if the given command has a handler.
  22. *
  23. * @param mixed $command
  24. * @return bool
  25. */
  26. public function hasCommandHandler($command);
  27. /**
  28. * Retrieve the handler for a command.
  29. *
  30. * @param mixed $command
  31. * @return bool|mixed
  32. */
  33. public function getCommandHandler($command);
  34. /**
  35. * Set the pipes commands should be piped through before dispatching.
  36. *
  37. * @param array $pipes
  38. * @return $this
  39. */
  40. public function pipeThrough(array $pipes);
  41. /**
  42. * Map a command to a handler.
  43. *
  44. * @param array $map
  45. * @return $this
  46. */
  47. public function map(array $map);
  48. }