OauthScopes::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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