| 1 | <?php |
||
| 16 | abstract class NotificationAdapter |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Find whether we should/can send messages using this adapter |
||
| 20 | * @return bool |
||
| 21 | */ |
||
| 22 | public static function isEnabled() |
||
| 23 | { |
||
| 24 | // Don't push notifications when testing |
||
| 25 | return \Service::getEnvironment() != "test"; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Trigger a notification |
||
| 30 | * @param string $channel The channel to send the message on |
||
| 31 | * @param string $message The content of the message to send |
||
| 32 | */ |
||
| 33 | abstract public function trigger($channel, $message); |
||
| 34 | } |
||
| 35 |