Oauth2Controller::behaviors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace zacksleo\yii2\oauth2\api\components;
4
5
use yii\helpers\ArrayHelper;
6
use yii\filters\auth\HttpBearerAuth;
7
use yii\filters\auth\QueryParamAuth;
8
use filsh\yii2\oauth2server\filters\auth\CompositeAuth;
9
10
/**
11
 * Class AuthController
12
 */
13
class Oauth2Controller extends RestController
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public function behaviors()
19
    {
20
        return ArrayHelper::merge(parent::behaviors(), [
21
            'authenticator' => [
22
                'class' => CompositeAuth::className(),
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
23
                'authMethods' => [
24
                    ['class' => HttpBearerAuth::className()],
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
25
                    ['class' => QueryParamAuth::className(), 'tokenParam' => 'access_token'],
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
26
                ]
27
            ],
28
        ]);
29
    }
30
}
31