User::loginByAccessToken()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 9
rs 10
c 0
b 0
f 0
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