Completed
Push — master ( 7eb1a4...254269 )
by LEUNG
03:41
created

User   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
A hasInject() 0 3 1
A getConfig() 0 3 1
A getModel() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace xiaodi\JWTAuth;
6
7
use think\App;
8
9
class User
10
{
11
    private $inject = true;
12
    private $model;
13
14
    public function __construct()
15
    {
16
        $config = $this->getConfig();
17
        foreach ($config as $key => $v) {
18
            $this->$key = $v;
19
        }
20
    }
21
22
    public function getConfig()
23
    {
24
        return $this->app->config->get('jwt.user', []);
0 ignored issues
show
Bug Best Practice introduced by
The property app does not exist on xiaodi\JWTAuth\User. Did you maybe forget to declare it?
Loading history...
25
    }
26
27
    public function hasInject()
28
    {
29
        return $this->inject;
30
    }
31
32
    public function getModel()
33
    {
34
        return $this->model;
35
    }
36
}
37