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