User::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 21
rs 9.8666
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Auth\Model;
4
5
use Drone\Db\Entity;
6
7
class User extends Entity
8
{
9
	/**
10
	 * @var string
11
	 */
12
    public $TOKEN;
13
14
	/**
15
	 * @var date
0 ignored issues
show
Bug introduced by
The type Auth\Model\date 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...
16
	 */
17
    public $RECORD_DATE;
18
19
    public function __construct($data = [])
20
    {
21
		$config = include 'module/Auth/config/user.config.php';
22
23
        $username_str = $config["authentication"]["gateway"]["credentials"]["username"];
24
        $password_str = $config["authentication"]["gateway"]["credentials"]["password"];
25
        $state_field  = $config["authentication"]["gateway"]["table_info"]["columns"]["state_field"];
26
        $email_field  = $config["authentication"]["gateway"]["table_info"]["columns"]["email_field"];
27
        $id_field     = $config["authentication"]["gateway"]["table_info"]["columns"]["id_field"];
28
29
        foreach ([$id_field, $username_str, $password_str, $state_field, $email_field] as $field)
30
        {
31
            $this->{$field} = null;
32
        }
33
34
    	parent::__construct($data);
35
36
		$table  = $config["authentication"]["gateway"]["entity"];
37
		$prefix = $config["database"]["prefix"];
38
39
        $this->setTableName($prefix . "_" . $table);
40
    }
41
}