OauthScopes   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 33.33%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 30
ccs 2
cts 6
cp 0.3333
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A attributeLabels() 0 5 1
A rules() 0 6 1
A tableName() 0 3 1
1
<?php
2
3
namespace roaresearch\yii2\oauth2server\models;
4
5
use Yii;
6
use yii\db\{ActiveQuery, ActiveRecord};
7
8
/**
9
 * This is the model class for table "oauth_scopes".
10
 *
11
 * @property string $scope
12
 * @property integer $is_default
13
 */
14
class OauthScopes extends \yii\db\ActiveRecord
15
{
16
    /**
17
     * @inheritdoc
18
     */
19 1
    public static function tableName(): string
20
    {
21 1
        return '{{%oauth_scopes}}';
22
    }
23
24
    /**
25
     * @inheritdoc
26
     */
27
    public function rules(): array
28
    {
29
        return [
30
            [['scope', 'is_default'], 'required'],
31
            [['is_default'], 'integer'],
32
            [['scope'], 'string', 'max' => 2000]
33
        ];
34
    }
35
36
    /**
37
     * @inheritdoc
38
     */
39
    public function attributeLabels(): array
40
    {
41
        return [
42
            'scope' => 'Scope',
43
            'is_default' => 'Is Default',
44
        ];
45
    }
46
}
47