TestUser   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 7
c 1
b 0
f 0
dl 0
loc 36
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A validateAuthKey() 0 3 1
A findIdentityByAccessToken() 0 3 1
A findIdentity() 0 3 1
A getAuthKey() 0 3 1
A getId() 0 3 1
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