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

Oauth2RefreshToken::getAccessToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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_refresh_token".
12
 *
13
 * @property string $id
14
 * @property string $access_token_id
15
 * @property string $identifier
16
 * @property string $expiry_date_time
17
 * @property integer $enabled
18
 * @property integer $created_at
19
 * @property integer $updated_at
20
 *
21
 * @property \rhertogh\Yii2Oauth2Server\models\Oauth2AccessToken $accessToken
22
 * @property string $aliasModel
23
 *
24
 * phpcs:disable Generic.Files.LineLength.TooLong
25
 */
26
abstract class Oauth2RefreshToken extends \rhertogh\Yii2Oauth2Server\models\base\Oauth2BaseActiveRecord
27
{
28
    /**
29
     * @inheritdoc
30
     */
31 3
    public function rules()
32
    {
33
        return [
34 3
            [['access_token_id', 'enabled', 'created_at', 'updated_at'], 'integer'],
35
            [['identifier', 'expiry_date_time', 'created_at', 'updated_at'], 'required'],
36
            [['expiry_date_time'], 'safe'],
37
            [['identifier'], 'string', 'max' => 255],
38
            [['identifier'], 'unique']
39
        ];
40
    }
41
42
    /**
43
     * @inheritdoc
44
     */
45 1
    public function attributeLabels()
46
    {
47
        return [
48 1
            'id' => Yii::t('oauth2', 'ID'),
49 1
            'access_token_id' => Yii::t('oauth2', 'Access Token ID'),
50 1
            'identifier' => Yii::t('oauth2', 'Identifier'),
51 1
            'expiry_date_time' => Yii::t('oauth2', 'Expiry Date Time'),
52 1
            'enabled' => Yii::t('oauth2', 'Enabled'),
53 1
            'created_at' => Yii::t('oauth2', 'Created At'),
54 1
            'updated_at' => Yii::t('oauth2', 'Updated At'),
55
        ];
56
    }
57
58
    /**
59
     * @return \rhertogh\Yii2Oauth2Server\interfaces\models\queries\Oauth2AccessTokenQueryInterface     */
60 5
    public function getAccessToken()
61
    {
62 5
        return $this->hasOne(\rhertogh\Yii2Oauth2Server\models\Oauth2AccessToken::className(), ['id' => 'access_token_id'])->inverseOf('refreshTokens');
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

62
        return $this->hasOne(/** @scrutinizer ignore-deprecated */ \rhertogh\Yii2Oauth2Server\models\Oauth2AccessToken::className(), ['id' => 'access_token_id'])->inverseOf('refreshTokens');

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