Completed
Push — master ( 4dd992...7f3992 )
by Cheren
04:17
created

User   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A _setPassword() 0 4 1
1
<?php
2
/**
3
 * CakeCMS Community
4
 *
5
 * This file is part of the of the simple cms based on CakePHP 3.
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @package     Community
10
 * @license     MIT
11
 * @copyright   MIT License http://www.opensource.org/licenses/mit-license.php
12
 * @link        https://github.com/CakeCMS/Community".
13
 * @author      Sergey Kalistratov <[email protected]>
14
 */
15
16
namespace Community\Model\Entity;
17
18
use Cake\I18n\FrozenTime;
19
use Core\ORM\Entity\Entity;
20
use Cake\Auth\DefaultPasswordHasher;
21
22
/**
23
 * Class User
24
 *
25
 * @package Community\Model\Entity
26
 * @property int $id
27
 * @property int $group_id
28
 * @property Group $group
29
 * @property string $login
30
 * @property string $name
31
 * @property string $slug
32
 * @property string $email
33
 * @property string $password
34
 * @property string $token
35
 * @property bool $status
36
 * @property FrozenTime $last_login
37
 * @property FrozenTime $last_action
38
 * @property FrozenTime $modified
39
 * @property FrozenTime $created
40
 */
41
class User extends Entity
42
{
43
44
    /**
45
     * Setup password.
46
     *
47
     * @param string $password
48
     * @return bool|string
49
     */
50
    protected function _setPassword($password)
51
    {
52
        return (new DefaultPasswordHasher())->hash($password);
53
    }
54
}
55