Controller   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A behaviors() 0 7 1
1
<?php
2
/**
3
 * @author Anton Tuyakhov <[email protected]>
4
 */
5
6
namespace tuyakhov\jsonapi;
7
8
9
use yii\filters\ContentNegotiator;
10
use yii\helpers\ArrayHelper;
11
use yii\web\Response;
12
13
class Controller extends \yii\rest\Controller
14
{
15
    public $serializer = 'tuyakhov\jsonapi\Serializer';
16
17
    /**
18
     * @inheritdoc
19
     */
20
    public function behaviors()
21
    {
22
        return ArrayHelper::merge(parent::behaviors(), [
23
            'contentNegotiator' => [
24
                'class' => ContentNegotiator::className(),
0 ignored issues
show
Deprecated Code introduced by
The function yii\base\BaseObject::className() has been deprecated: since 2.0.14. On PHP >=5.5, use `::class` instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

24
                'class' => /** @scrutinizer ignore-deprecated */ ContentNegotiator::className(),

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

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

Loading history...
25
                'formats' => [
26
                    'application/vnd.api+json' => Response::FORMAT_JSON,
27
                ],
28
            ]
29
        ]);
30
    }
31
32
}