| Conditions | 3 |
| Paths | 4 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace RuleCom\Notifier; |
||
| 16 | public function register() |
||
| 17 | { |
||
| 18 | $debugEnabled = $this->app['config']['rule-notifier']['debug']; |
||
| 19 | |||
| 20 | $emailChannel = new Email(new Client, new Logger('Notification logger')); |
||
| 21 | $emailChannel->apiKey($this->app['config']['rule-notifier']['api_key']); |
||
| 22 | |||
| 23 | if ($debugEnabled) { |
||
| 24 | $emailChannel->debug($this->app['config']['rule-notifier']['log_path']); |
||
| 25 | } |
||
| 26 | |||
| 27 | $this->app->instance(Email::class, $emailChannel); |
||
| 28 | |||
| 29 | $slackChannel = new Slack(new Client, new Logger('Notification logger')); |
||
| 30 | $slackChannel->endpoint($this->app['config']['rule-notifier']['slack_endpoint']); |
||
| 31 | |||
| 32 | if ($debugEnabled) { |
||
| 33 | $slackChannel->debug($this->app['config']['rule-notifier']['log_path']); |
||
| 34 | } |
||
| 35 | |||
| 36 | $this->app->instance(Slack::class, $slackChannel); |
||
| 37 | } |
||
| 38 | |||
| 51 |