TestUser::findIdentityByAccessToken()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
namespace RazonYang\Yii2\RateLimiter\Tests;
3
4
use yii\web\IdentityInterface;
5
6
class TestUser implements IdentityInterface
7
{
8
    public $id;
9
10
    public static function findIdentity($id)
11
    {
12
        return null;
13
    }
14
15
    /**
16
     * Finds an identity by the given token.
17
     * @param mixed $token the token to be looked for
18
     * @param mixed $type the type of the token. The value of this parameter depends on the implementation.
19
     * For example, [[\yii\filters\auth\HttpBearerAuth]] will set this parameter to be `yii\filters\auth\HttpBearerAuth`.
20
     * @return IdentityInterface|null the identity object that matches the given token.
21
     * Null should be returned if such an identity cannot be found
22
     * or the identity is not in an active state (disabled, deleted, etc.)
23
     */
24
    public static function findIdentityByAccessToken($token, $type = null)
25
    {
26
        return null;
27
    }
28
29
    public function getId()
30
    {
31
        return $this->id;
32
    }
33
34
    public function getAuthKey()
35
    {
36
        return '';
37
    }
38
39
    public function validateAuthKey($authKey)
40
    {
41
        return false;
42
    }
43
}
44