Passed
Push — master ( 391225...942304 )
by Rutger
14:53 queued 11:50
created

Oauth2AuthCodeScope   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 12
c 1
b 0
f 0
dl 0
loc 49
ccs 12
cts 12
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A find() 0 3 1
A rules() 0 6 1
A attributeLabels() 0 6 1
A getScope() 0 3 1
A getAuthCode() 0 3 1
1
<?php
2
3
// This class was automatically generated by a giiant build task.
4
// You should not change it manually as it will be overwritten on next build.
5
6
namespace rhertogh\Yii2Oauth2Server\models\base;
7
8
use Yii;
9
10
/**
11
 * This is the base-model class for table "oauth2_auth_code_scope".
12
 *
13
 * @property string $auth_code_id
14
 * @property integer $scope_id
15
 * @property integer $created_at
16
 *
17
 * @property \rhertogh\Yii2Oauth2Server\models\Oauth2AuthCode $authCode
18
 * @property \rhertogh\Yii2Oauth2Server\models\Oauth2Scope $scope
19
 * @property string $aliasModel
20
 *
21
 * phpcs:disable Generic.Files.LineLength.TooLong
22
 */
23
abstract class Oauth2AuthCodeScope extends \rhertogh\Yii2Oauth2Server\models\base\Oauth2BaseActiveRecord
24
{
25
    /**
26
     * @inheritdoc
27
     */
28 4
    public function rules()
29
    {
30
        return [
31 4
            [['auth_code_id', 'scope_id', 'created_at'], 'required'],
32
            [['auth_code_id', 'scope_id', 'created_at'], 'integer'],
33
            [['auth_code_id', 'scope_id'], 'unique', 'targetAttribute' => ['auth_code_id', 'scope_id']]
34
        ];
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40 1
    public function attributeLabels()
41
    {
42
        return [
43 1
            'auth_code_id' => Yii::t('oauth2', 'Auth Code ID'),
44 1
            'scope_id' => Yii::t('oauth2', 'Scope ID'),
45 1
            'created_at' => Yii::t('oauth2', 'Created At'),
46
        ];
47
    }
48
49
    /**
50
     * @return \rhertogh\Yii2Oauth2Server\interfaces\models\queries\Oauth2AuthCodeQueryInterface     */
51 1
    public function getAuthCode()
52
    {
53 1
        return $this->hasOne(\rhertogh\Yii2Oauth2Server\models\Oauth2AuthCode::className(), ['id' => 'auth_code_id'])->inverseOf('authCodeScopes');
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

53
        return $this->hasOne(/** @scrutinizer ignore-deprecated */ \rhertogh\Yii2Oauth2Server\models\Oauth2AuthCode::className(), ['id' => 'auth_code_id'])->inverseOf('authCodeScopes');

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...
54
    }
55
56
    /**
57
     * @return \rhertogh\Yii2Oauth2Server\interfaces\models\queries\Oauth2ScopeQueryInterface     */
58 1
    public function getScope()
59
    {
60 1
        return $this->hasOne(\rhertogh\Yii2Oauth2Server\models\Oauth2Scope::className(), ['id' => 'scope_id'])->inverseOf('authCodeScopes');
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

60
        return $this->hasOne(/** @scrutinizer ignore-deprecated */ \rhertogh\Yii2Oauth2Server\models\Oauth2Scope::className(), ['id' => 'scope_id'])->inverseOf('authCodeScopes');

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...
61
    }
62
63
64
65
    /**
66
     * @inheritdoc
67
     * @return \rhertogh\Yii2Oauth2Server\interfaces\models\queries\Oauth2AuthCodeScopeQueryInterface the active query used by this AR class.
68
     */
69 4
    public static function find()
70
    {
71 4
        return Yii::createObject(\rhertogh\Yii2Oauth2Server\interfaces\models\queries\Oauth2AuthCodeScopeQueryInterface::class, [get_called_class()]);
72
    }
73
}
74