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): void |
|
70 | |||
71 | /** |
||
72 | * @param string $msg |
||
73 | */ |
||
74 | 1 | private function log(string $msg): void |
|
82 | |||
83 | /** |
||
84 | * @return callable |
||
85 | * |
||
86 | * @throws \RuntimeException |
||
87 | */ |
||
88 | 1 | private function findHandler($message): callable |
|
103 | } |
||
104 |