Conditions | 4 |
Paths | 5 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | public function publish(Message $message): bool |
||
37 | { |
||
38 | try { |
||
39 | $allPublished = true; |
||
40 | foreach ($this->publishers as $publisher) { |
||
41 | if ($publisher->canPublish($message)) { |
||
42 | $allPublished &= $publisher->publish($message); |
||
43 | } |
||
44 | } |
||
45 | |||
46 | return (bool) $allPublished; |
||
47 | } catch (\Exception $e) { |
||
48 | throw new FailureWhenPublishingMessage($e); |
||
49 | } |
||
52 |