| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | public function behaviors() |
||
| 46 | { |
||
| 47 | $behaviors = []; |
||
| 48 | if (\Yii::$app->user->isGuest) { |
||
| 49 | if ($this->module->auth) { |
||
| 50 | $auth = $this->module->auth; |
||
| 51 | } else { |
||
| 52 | $auth = [$this->module, 'auth']; |
||
| 53 | } |
||
| 54 | $behaviors = [ |
||
| 55 | 'basicAuth' => [ |
||
| 56 | 'class' => HttpBasicAuth::class, |
||
| 57 | 'auth' => $auth |
||
| 58 | ], |
||
| 59 | ]; |
||
| 60 | } |
||
| 61 | return $behaviors; |
||
| 62 | } |
||
| 63 | } |