1 | <?php |
||
17 | abstract class AbstractBus implements BusInterface |
||
18 | { |
||
19 | // Message handlers |
||
20 | private $handlers; |
||
21 | |||
22 | private $logger; |
||
23 | |||
24 | /** |
||
25 | * @param LoggerInterface|null $logger |
||
26 | */ |
||
27 | 8 | public function __construct(?LoggerInterface $logger = null) |
|
31 | |||
32 | /** |
||
33 | * @param mixed $handler |
||
34 | */ |
||
35 | 2 | public function registerHandler($handler): AbstractBus |
|
44 | |||
45 | /** |
||
46 | * @param mixed $message |
||
47 | * |
||
48 | * @throws \Assert\AssertionFailedException |
||
49 | */ |
||
50 | 1 | public function post($message, ?callable $callback = null): void |
|
74 | |||
75 | /** |
||
76 | * @param string $msg |
||
77 | */ |
||
78 | 1 | private function log(string $msg): void |
|
86 | |||
87 | /** |
||
88 | * @return callable |
||
89 | * |
||
90 | * @throws \RuntimeException |
||
91 | */ |
||
92 | 1 | private function findHandler($message): callable |
|
107 | } |
||
108 |