| Conditions | 4 |
| Paths | 5 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | public function publish(Message $message): bool |
||
| 47 | { |
||
| 48 | try { |
||
| 49 | $allPublished = (int)true; |
||
| 50 | foreach ($this->publishers as $publisher) { |
||
| 51 | if ($publisher->canPublish($message)) { |
||
| 52 | $allPublished &= $publisher->publish($message); |
||
| 53 | } |
||
| 54 | } |
||
| 55 | |||
| 56 | return (bool)$allPublished; |
||
| 57 | } catch (Throwable $t) { |
||
| 58 | throw new FailureWhenPublishingMessage($t); |
||
| 59 | } |
||
| 60 | } |
||
| 61 | } |
||
| 62 |