| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function init() |
||
| 19 | { |
||
| 20 | if (!class_exists(SentrySdk::class)) { |
||
| 21 | return; |
||
| 22 | } |
||
| 23 | if (!empty(SentrySdk::getCurrentHub()->getClient())) { |
||
| 24 | return; |
||
| 25 | } |
||
| 26 | |||
| 27 | $params = Yii::$app->params; |
||
| 28 | if (empty($params['sentry.dsn']) || empty($params['sentry.enabled'])) { |
||
| 29 | return; |
||
| 30 | } |
||
| 31 | |||
| 32 | \Sentry\init(['dsn' => $params['sentry.dsn']]); |
||
| 33 | } |
||
| 34 | } |
||
| 35 |