| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | 1 | public function boot() |
|
| 14 | { |
||
| 15 | 1 | $config = $this->app->config->get('bugsnag', []) + ['api_key' => null]; |
|
| 16 | 1 | $bugsnag = Client::make($config['api_key']); |
|
| 17 | 1 | foreach ($config as $key => $value) { |
|
| 18 | 1 | $method = 'set' . implode('', array_map('ucfirst', explode('_', $key))); |
|
| 19 | 1 | if (method_exists($bugsnag, $method) && !is_null($value)) { |
|
| 20 | 1 | $bugsnag->$method($value); |
|
| 21 | } |
||
| 22 | } |
||
| 23 | 1 | Handler::register($bugsnag); |
|
| 24 | 1 | $this->app->bind('bugsnag', $bugsnag); |
|
| 25 | } |
||
| 27 |