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

User::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 5
rs 10
c 1
b 0
f 0
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