Oauth2BaseApiController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 9
c 1
b 0
f 0
dl 0
loc 20
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A behaviors() 0 10 1
1
<?php
2
3
namespace rhertogh\Yii2Oauth2Server\controllers\web\base;
4
5
use yii\filters\ContentNegotiator;
6
use yii\filters\Cors;
7
use yii\web\Response;
8
9
abstract class Oauth2BaseApiController extends Oauth2BaseWebController
10
{
11
    /**
12
     * @inheritDoc
13
     */
14
    public $enableCsrfValidation = false;
15
16
    /**
17
     * @inheritDoc
18
     */
19 6
    public function behaviors()
20
    {
21 6
        return [
22 6
            'cors' => [
23 6
                'class' => Cors::class,
24 6
            ],
25 6
            'contentNegotiator' => [
26 6
                'class' => ContentNegotiator::class,
27 6
                'formats' => [
28 6
                    'application/json' => Response::FORMAT_JSON,
29 6
                ],
30 6
            ],
31 6
        ];
32
    }
33
}
34