Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | class AssertingDispatcher implements Dispatcher |
||
18 | { |
||
19 | /** |
||
20 | * @var callable |
||
21 | */ |
||
22 | private $assertion; |
||
23 | |||
24 | /** |
||
25 | * @param callable $assertion |
||
26 | * A callable that should throw an exception if the message shouldn't be dispatched. |
||
27 | */ |
||
28 | public function __construct( |
||
29 | private Dispatcher $dispatcher, |
||
30 | callable $assertion |
||
31 | ) { |
||
32 | $this->dispatcher = $dispatcher; |
||
33 | $this->assertion = $assertion; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param object $message |
||
38 | * |
||
39 | * @return mixed |
||
40 | */ |
||
41 | public function dispatch(object $message) |
||
46 | } |
||
47 | } |
||
48 |