1 | <?php |
||
9 | final class Routing |
||
10 | { |
||
11 | /** |
||
12 | * [ |
||
13 | * 'busId_1' => [ |
||
14 | * 'My\Command\Name1' => 'some.service.id', |
||
15 | * 'My\Other\Command' => 'some.service.id.or.same.one' |
||
16 | * ], |
||
17 | * 'busId_2' => [ |
||
18 | * 'Legacy\App\Command1' => 'some.old.handler', |
||
19 | * ... |
||
20 | * ], |
||
21 | * ] |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | private $mapping = []; |
||
26 | |||
27 | 165 | public function __construct(array $validBusIds) |
|
33 | |||
34 | 45 | public function routeToBus($busId, $commandClassName, $serviceId) |
|
41 | |||
42 | 57 | public function routeToAllBuses($commandClassName, $serviceId) |
|
50 | |||
51 | 147 | public function commandToServiceMapping(string $busId): array |
|
56 | |||
57 | 162 | private function assertValidBusId(string $busId) |
|
63 | |||
64 | /** |
||
65 | * @param $commandClassName |
||
66 | * @param $serviceId |
||
67 | */ |
||
68 | 81 | protected function assertValidCommandFQCN($commandClassName, $serviceId) |
|
74 | } |