Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function execute(Notification $notification) |
||
24 | { |
||
25 | try { |
||
26 | $gateway = $this->gatewayRegistry->get($notification->destination()); |
||
27 | } catch (InvalidArgumentException $e) { |
||
28 | $notification->markFailed('Gateway not found: ' . $e->__toString()); |
||
29 | |||
30 | return; |
||
31 | } |
||
32 | try { |
||
33 | $gateway->send($notification); |
||
34 | $notification->markSent(); |
||
35 | } catch (NotificationNotSentException $e) { |
||
36 | $notification->markFailed('Gateway failed to send: ' . $e->__toString()); |
||
37 | } |
||
38 | } |
||
39 | } |
||
40 |