User   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 33
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A hashPassword() 0 4 1
1
<?php
2
3
namespace Peto16\User;
4
5
/**
6
 * Class to handle a user.
7
 */
8
class User
9
{
10
11
    /**
12
     * Columns in the table.
13
     *
14
     * @var integer $id primary key auto incremented.
15
     */
16
17
    public $id;
18
    public $username;
19
    public $password;
20
    public $email;
21
    public $firstname;
22
    public $lastname;
23
    public $administrator;
24
    public $enabled;
25
    public $deleted;
26
27
28
29
    /**
30
     * Set the password.
31
     *
32
     * @param string $password the password to use.
33
     *
34
     * @return string   return hashed password.
35
     */
36 2
    public function hashPassword($password)
37
    {
38 2
        return password_hash($password, PASSWORD_DEFAULT);
39
    }
40
}
41