User   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A loginByAccessToken() 0 9 2
1
<?php
2
3
namespace yrc\web;
4
5
use yii\web\User as YiiUser;
6
7
class User extends YiiUser
8
{
9
    /**
10
     * Overloads \yii\web\User::loginByAccessToken
11
     * to provide the token used to authenticate the user
12
     * @param app\models\Token $token
0 ignored issues
show
Bug introduced by
The type yrc\web\app\models\Token was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
     * @param mixed $type
14
     * @return Identity
0 ignored issues
show
Bug introduced by
The type yrc\web\Identity was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
     */
16
    public function loginByAccessToken($token, $type = null)
17
    {
18
        $identity = parent::loginByAccessToken($token, $type);
19
        
20
        if ($identity !== null) {
21
            $identity->setToken($token);
22
        }
23
24
        return $identity;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $identity also could return the type yii\web\IdentityInterface which is incompatible with the documented return type yrc\web\Identity.
Loading history...
25
    }
26
}
27